Class: Parser::Source::Map::Constant

Inherits:
Parser::Source::Map show all
Defined in:
lib/parser/source/map/constant.rb

Instance Attribute Summary collapse

Attributes inherited from Parser::Source::Map

#expression, #node

Instance Method Summary collapse

Methods inherited from Parser::Source::Map

#==, #column, #initialize_copy, #last_column, #last_line, #line, #to_hash, #with_expression

Constructor Details

#initialize(double_colon, name, expression) ⇒ Constant

Returns a new instance of Constant.



11
12
13
14
15
# File 'lib/parser/source/map/constant.rb', line 11

def initialize(double_colon, name, expression)
  @double_colon, @name = double_colon, name

  super(expression)
end

Instance Attribute Details

#double_colonObject (readonly)



7
8
9
# File 'lib/parser/source/map/constant.rb', line 7

def double_colon
  @double_colon
end

#nameObject (readonly)



8
9
10
# File 'lib/parser/source/map/constant.rb', line 8

def name
  @name
end

#operatorObject (readonly)



9
10
11
# File 'lib/parser/source/map/constant.rb', line 9

def operator
  @operator
end

Instance Method Details

#with_operator(operator_l) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/parser/source/map/constant.rb', line 20

def with_operator(operator_l)
  with { |map| map.update_operator(operator_l) }
end