Class: Potter::AST::Binary
Instance Method Summary collapse
- #eval ⇒ Object
-
#initialize(left, right) ⇒ Binary
constructor
A new instance of Binary.
- #walk {|@left| ... } ⇒ Object
Methods inherited from Node
#eql?, #hash, #name, #symbol, #visit
Constructor Details
#initialize(left, right) ⇒ Binary
Returns a new instance of Binary.
4 5 6 7 8 |
# File 'lib/potter/ast/binary.rb', line 4 def initialize(left, right) super() @left = left @right = right end |
Instance Method Details
#eval ⇒ Object
15 |
# File 'lib/potter/ast/binary.rb', line 15 def eval = @left.eval.public_send(symbol, @right.eval) |
#walk {|@left| ... } ⇒ Object
10 11 12 13 |
# File 'lib/potter/ast/binary.rb', line 10 def walk yield @left yield @right end |