Class: Rjq::AST::Assignment
Constant Summary collapse
- DELETE =
Object.new.freeze
- NO_OUTPUT =
Object.new.freeze
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Attributes inherited from Node
Instance Method Summary collapse
- #eval(input, context) ⇒ Object
-
#initialize(left, op, right) ⇒ Assignment
constructor
A new instance of Assignment.
Methods inherited from Node
#assign_value, #invalid_path_message, #paths, #take, #with_source_span
Constructor Details
#initialize(left, op, right) ⇒ Assignment
Returns a new instance of Assignment.
990 991 992 993 994 |
# File 'lib/rjq/ast.rb', line 990 def initialize(left, op, right) @left = left @op = op @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
988 989 990 |
# File 'lib/rjq/ast.rb', line 988 def left @left end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
988 989 990 |
# File 'lib/rjq/ast.rb', line 988 def op @op end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
988 989 990 |
# File 'lib/rjq/ast.rb', line 988 def right @right end |
Instance Method Details
#eval(input, context) ⇒ Object
996 997 998 |
# File 'lib/rjq/ast.rb', line 996 def eval(input, context) @op == '=' ? assign(input, context) : update(input, context) end |