Module: Amount::Operations

Included in:
Amount, NilAmount
Defined in:
lib/amountable/amount.rb

Instance Method Summary collapse

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_moneyObject



30
31
32
# File 'lib/amountable/amount.rb', line 30

def to_money
  value
end