Class: Parser::Source::Map::Constant
- Inherits:
-
Parser::Source::Map
- Object
- Parser::Source::Map
- Parser::Source::Map::Constant
- Defined in:
- lib/parser/source/map/constant.rb
Instance Attribute Summary collapse
-
#double_colon ⇒ Object
readonly
Returns the value of attribute double_colon.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
Attributes inherited from Parser::Source::Map
Instance Method Summary collapse
-
#initialize(double_colon, name, expression) ⇒ Constant
constructor
A new instance of Constant.
- #update_operator(operator_l) ⇒ Object protected
- #with_operator(operator_l) ⇒ Object
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_colon ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/parser/source/map/constant.rb', line 6 def name @name end |
#operator ⇒ Object (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 |