Module: Amount::Operations

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

Instance Method Summary collapse

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_moneyObject



37
38
39
# File 'lib/amountable/amount.rb', line 37

def to_money
  value
end