Class: Dentaku::AST::Arithmetic
- Defined in:
- lib/dentaku/ast/arithmetic.rb
Direct Known Subclasses
Addition, Division, Exponentiation, Multiplication, Subtraction
Instance Attribute Summary
Attributes inherited from Operation
Instance Method Summary collapse
-
#initialize ⇒ Arithmetic
constructor
A new instance of Arithmetic.
- #type ⇒ Object
Methods inherited from Operation
#dependencies, right_associative?
Methods inherited from Node
Constructor Details
#initialize ⇒ Arithmetic
Returns a new instance of Arithmetic.
6 7 8 9 |
# File 'lib/dentaku/ast/arithmetic.rb', line 6 def initialize(*) super fail "#{ self.class } requires numeric operands" unless valid_node?(left) && valid_node?(right) end |
Instance Method Details
#type ⇒ Object
11 12 13 |
# File 'lib/dentaku/ast/arithmetic.rb', line 11 def type :numeric end |