class RuboCop::AST::NodePattern::Comment

A NodePattern comment, simplified version of ::Parser::Source::Comment

def ==(other)

Returns:
  • (Boolean) -

Parameters:
  • other (Object) --
def ==(other)
  other.is_a?(Comment) &&
    @location == other.location
end

def initialize(range)

Parameters:
  • range (Parser::Source::Range) --
def initialize(range)
  @location = ::Parser::Source::Map.new(range)
  freeze
end

def inspect

Returns:
  • (String) - a human-readable representation of this comment
def inspect
  "#<NodePattern::Comment #{@location.expression} #{text.inspect}>"
end

def text

Returns:
  • (String) -
def text
  loc.expression.source.freeze
end