module RubyLint::VariablePredicates

Module that provides various predicate methods for checking node/definition types.

Constants

PREDICATE_METHODS

Array containing various predicate methods to create.

@return [Array]

RUBY_CLASSES

Hash containing various Node types and the associated Ruby classes.

@return [Hash]

VARIABLE_TYPES

List of variable types used in {#variable?}.

@return [Array]

Public Instance Methods

constant?() click to toggle source

@return [TrueClass|FalseClass]

# File lib/ruby-lint/variable_predicates.rb, line 54
def constant?
  return type == :const || type == :module || type == :class
end
constant_path?() click to toggle source

@return [TrueClass|FalseClass]

# File lib/ruby-lint/variable_predicates.rb, line 61
def constant_path?
  return constant? && children[0].constant?
end
ruby_class() click to toggle source

@return [String]

# File lib/ruby-lint/variable_predicates.rb, line 68
def ruby_class
  return RUBY_CLASSES[type]
end
variable?() click to toggle source

@return [TrueClass|FalseClass]

# File lib/ruby-lint/variable_predicates.rb, line 75
def variable?
  return VARIABLE_TYPES.include?(type)
end