Class: Estreet::BinaryExpression
- Inherits:
-
Expression
- Object
- Node
- Expression
- Estreet::BinaryExpression
- Defined in:
- lib/estreet/binary_expression.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(operator, left, right) ⇒ BinaryExpression
constructor
A new instance of BinaryExpression.
Methods inherited from Expression
#[], #call, coerce, #property, #to_expression, #to_statement
Methods inherited from Node
Constructor Details
#initialize(operator, left, right) ⇒ BinaryExpression
Returns a new instance of BinaryExpression.
3 4 5 6 7 8 9 |
# File 'lib/estreet/binary_expression.rb', line 3 def initialize(operator, left, right) Estreet.assert_valid_operator(BINARY_OPERATORS, operator) @operator = operator @left = left.to_expression @right = right.to_expression end |
Instance Method Details
#attributes ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/estreet/binary_expression.rb', line 11 def attributes super.merge( operator: @operator, left: @left, right: @right ) end |