Module: Amount::Operations
Instance Method Summary collapse
- #*(multiplier) ⇒ Object
- #+(other_value) ⇒ Object
- #-(other_value) ⇒ Object
- #/(divisor) ⇒ Object
- #to_money ⇒ Object
Instance Method Details
#*(multiplier) ⇒ Object
22 23 24 |
# File 'lib/amountable/amount.rb', line 22 def *(multiplier) value * multiplier end |
#+(other_value) ⇒ Object
14 15 16 |
# File 'lib/amountable/amount.rb', line 14 def +(other_value) value + other_value.to_money end |
#-(other_value) ⇒ Object
18 19 20 |
# File 'lib/amountable/amount.rb', line 18 def -(other_value) value - other_value.to_money end |
#/(divisor) ⇒ Object
26 27 28 |
# File 'lib/amountable/amount.rb', line 26 def /(divisor) value / divisor end |
#to_money ⇒ Object
30 31 32 |
# File 'lib/amountable/amount.rb', line 30 def to_money value end |