Class: Dentaku::AST::Combinator
- Defined in:
- lib/dentaku/ast/combinators.rb
Instance Attribute Summary
Attributes inherited from Operation
Instance Method Summary collapse
-
#initialize ⇒ Combinator
constructor
A new instance of Combinator.
- #type ⇒ Object
Methods inherited from Operation
#accept, #dependencies, #display_operator, max_param_count, min_param_count, right_associative?
Methods inherited from Node
arity, #dependencies, #name, precedence, resolve_class
Constructor Details
#initialize ⇒ Combinator
Returns a new instance of Combinator.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/dentaku/ast/combinators.rb', line 6 def initialize(*) super unless valid_node?(left) raise NodeError.new(:logical, left.type, :left), "#{self.class} requires logical operands" end unless valid_node?(right) raise NodeError.new(:logical, right.type, :right), "#{self.class} requires logical operands" end end |
Instance Method Details
#type ⇒ Object
19 20 21 |
# File 'lib/dentaku/ast/combinators.rb', line 19 def type :logical end |