Class: Parser::Source::Map::Variable
- Inherits:
-
Parser::Source::Map
- Object
- Parser::Source::Map
- Parser::Source::Map::Variable
- Defined in:
- lib/parser/source/map/variable.rb
Instance Attribute Summary collapse
-
#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(name_l, expression_l = name_l) ⇒ Variable
constructor
A new instance of Variable.
- #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(name_l, expression_l = name_l) ⇒ Variable
Returns a new instance of Variable.
8 9 10 11 12 |
# File 'lib/parser/source/map/variable.rb', line 8 def initialize(name_l, expression_l=name_l) @name = name_l super(expression_l) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/parser/source/map/variable.rb', line 5 def name @name end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
6 7 8 |
# File 'lib/parser/source/map/variable.rb', line 6 def operator @operator end |
Instance Method Details
#update_operator(operator_l) ⇒ Object (protected)
20 21 22 |
# File 'lib/parser/source/map/variable.rb', line 20 def update_operator(operator_l) @operator = operator_l end |
#with_operator(operator_l) ⇒ Object
14 15 16 |
# File 'lib/parser/source/map/variable.rb', line 14 def with_operator(operator_l) with { |map| map.update_operator(operator_l) } end |