Class: Parser::Source::Map::Variable

Inherits:
Parser::Source::Map show all
Defined in:
lib/parser/source/map/variable.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(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

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#operatorObject (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