Module: Danica::BaseOperations
- Included in:
- Expression, Operator, Wrapper::Constant, Wrapper::Group, Wrapper::Negative, Wrapper::Number, Wrapper::PlusMinus, Wrapper::Variable
- Defined in:
- lib/danica/base_operations.rb
Instance Method Summary collapse
- #*(other) ⇒ Object
- #**(other) ⇒ Object
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #-@ ⇒ Object
- #/(other) ⇒ Object
Instance Method Details
#*(other) ⇒ Object
9 10 11 |
# File 'lib/danica/base_operations.rb', line 9 def *(other) formatted_operation other, multiplication(self, other) end |
#**(other) ⇒ Object
21 22 23 |
# File 'lib/danica/base_operations.rb', line 21 def **(other) formatted_operation other, power(self, other) end |
#+(other) ⇒ Object
5 6 7 |
# File 'lib/danica/base_operations.rb', line 5 def +(other) formatted_operation other, addition(self, other) end |
#-(other) ⇒ Object
17 18 19 |
# File 'lib/danica/base_operations.rb', line 17 def -(other) formatted_operation other, (self + negative(other)) end |
#-@ ⇒ Object
25 26 27 |
# File 'lib/danica/base_operations.rb', line 25 def -@ negative(self) end |
#/(other) ⇒ Object
13 14 15 |
# File 'lib/danica/base_operations.rb', line 13 def /(other) formatted_operation other, division(self, other) end |