class RubyLint::AST::Node

Extends the Node class provided by the `parser` Gem with various extra methods.

Public Instance Methods

column() click to toggle source

@return [Numeric]

# File lib/ruby-lint/ast/node.rb, line 20
def column
  return location.expression.column + 1 if location
end
file() click to toggle source

@return [String]

# File lib/ruby-lint/ast/node.rb, line 27
def file
  return location.expression.source_buffer.name if location
end
inspect_oneline() click to toggle source

Similar to `#inspect` but formats the value so that it fits on a single line.

@return [String]

# File lib/ruby-lint/ast/node.rb, line 44
def inspect_oneline
  return to_s.gsub(/\s*\n\s*/, ' ')
end
line() click to toggle source

@return [Numeric]

# File lib/ruby-lint/ast/node.rb, line 13
def line
  return location.expression.line if location
end
name() click to toggle source

@return [String]

# File lib/ruby-lint/ast/node.rb, line 34
def name
  return const? ? children[-1].to_s : children[0].to_s
end