Module: Amountable::Operations

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

Instance Method Summary collapse

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_moneyObject



22
23
24
# File 'lib/amountable/operations.rb', line 22

def to_money
  value
end