Class: Keisan::AST::Times

Inherits:
ArithmeticOperator show all
Defined in:
lib/keisan/ast/times.rb

Instance Attribute Summary

Attributes inherited from Parent

#children

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ArithmeticOperator

#associativity

Methods inherited from Operator

#associativity, #value

Methods inherited from Node

#value

Constructor Details

#initialize(children = [], parsing_operators = []) ⇒ Times



4
5
6
7
# File 'lib/keisan/ast/times.rb', line 4

def initialize(children = [], parsing_operators = [])
  super
  convert_divide_to_inverse!
end

Class Method Details

.priorityObject



9
10
11
# File 'lib/keisan/ast/times.rb', line 9

def self.priority
  20
end

Instance Method Details

#arityObject



13
14
15
# File 'lib/keisan/ast/times.rb', line 13

def arity
  2..Float::INFINITY
end

#blank_valueObject



21
22
23
# File 'lib/keisan/ast/times.rb', line 21

def blank_value
  1
end

#symbolObject



17
18
19
# File 'lib/keisan/ast/times.rb', line 17

def symbol
  :*
end