Class: Ruby::Binary
- Defined in:
- lib/ruby/operator.rb
Instance Attribute Summary
Attributes included from Node::Composite
Instance Method Summary collapse
-
#initialize(operator, left, right) ⇒ Binary
constructor
A new instance of Binary.
- #nodes ⇒ Object
Methods inherited from Aggregate
#position, #position=, #prolog, #prolog=, #to_ruby
Methods inherited from Node
#<=>, #all_nodes, #column, #length, #row
Methods included from Conversions
Methods included from Node::Traversal
#has_token?, #has_type?, #has_value?, #is_instance_of?, #left_of?, #matches?, #position?, #right_of?, #select
Methods included from Node::Source
#context, #filename, #line, #lines, #src
Methods included from Node::Composite
Constructor Details
#initialize(operator, left, right) ⇒ Binary
Returns a new instance of Binary.
24 25 26 27 28 |
# File 'lib/ruby/operator.rb', line 24 def initialize(operator, left, right) self.operator = operator or raise "operator can not be nil" self.left = left self.right = right end |
Instance Method Details
#nodes ⇒ Object
30 31 32 |
# File 'lib/ruby/operator.rb', line 30 def nodes [left, operator, right].compact end |