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

Instance Method Summary collapse

Methods inherited from Parser::Source::Map

#line, #to_hash, #update_expression, #with, #with_expression

Constructor Details

#initialize(double_colon, name, expression) ⇒ Constant

Returns a new instance of Constant.



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

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

  super(expression)
end

Instance Attribute Details

#double_colonObject (readonly)

Returns the value of attribute double_colon.



5
6
7
# File 'lib/parser/source/map/constant.rb', line 5

def double_colon
  @double_colon
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#operatorObject (readonly)

Returns the value of attribute operator.



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

def operator
  @operator
end

Instance Method Details

#update_operator(operator_l) ⇒ Object (protected)



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

def update_operator(operator_l)
  @operator = operator_l
end

#with_operator(operator_l) ⇒ Object



15
16
17
# File 'lib/parser/source/map/constant.rb', line 15

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