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
29 30 31 |
# File 'lib/amountable/amount.rb', line 29 def *(multiplier) value * multiplier end |
#+(other_value) ⇒ Object
21 22 23 |
# File 'lib/amountable/amount.rb', line 21 def +(other_value) value + other_value.to_money end |
#-(other_value) ⇒ Object
25 26 27 |
# File 'lib/amountable/amount.rb', line 25 def -(other_value) value - other_value.to_money end |
#/(divisor) ⇒ Object
33 34 35 |
# File 'lib/amountable/amount.rb', line 33 def /(divisor) value / divisor end |
#to_money ⇒ Object
37 38 39 |
# File 'lib/amountable/amount.rb', line 37 def to_money value end |