Class: Baba::Expr::Binary
- Inherits:
-
Object
- Object
- Baba::Expr::Binary
- Defined in:
- lib/baba/expr.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(left, operator, right) ⇒ Binary
constructor
A new instance of Binary.
Constructor Details
#initialize(left, operator, right) ⇒ Binary
Returns a new instance of Binary.
18 19 20 |
# File 'lib/baba/expr.rb', line 18 def initialize(left, operator, right) @left = left; @operator = operator; @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
16 17 18 |
# File 'lib/baba/expr.rb', line 16 def left @left end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
16 17 18 |
# File 'lib/baba/expr.rb', line 16 def operator @operator end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
16 17 18 |
# File 'lib/baba/expr.rb', line 16 def right @right end |
Instance Method Details
#accept(visitor) ⇒ Object
22 23 24 |
# File 'lib/baba/expr.rb', line 22 def accept(visitor) visitor.visit_binary_expr(self) end |