Module: Amountable::Operations
- Included in:
- Amount, NilAmount, VirtualAmount
- Defined in:
- lib/amountable/operations.rb
Instance Method Summary collapse
- #*(multiplier) ⇒ Object
- #+(other_value) ⇒ Object
- #-(other_value) ⇒ Object
- #/(divisor) ⇒ Object
- #to_money ⇒ Object
Instance Method Details
#*(multiplier) ⇒ Object
14 15 16 |
# File 'lib/amountable/operations.rb', line 14 def *(multiplier) value * multiplier end |
#+(other_value) ⇒ Object
6 7 8 |
# File 'lib/amountable/operations.rb', line 6 def +(other_value) value + other_value.to_money end |
#-(other_value) ⇒ Object
10 11 12 |
# File 'lib/amountable/operations.rb', line 10 def -(other_value) value - other_value.to_money end |
#/(divisor) ⇒ Object
18 19 20 |
# File 'lib/amountable/operations.rb', line 18 def /(divisor) value / divisor end |
#to_money ⇒ Object
22 23 24 |
# File 'lib/amountable/operations.rb', line 22 def to_money value end |