Class: Money::ReverseOperationProxy

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/money/money.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ReverseOperationProxy

Returns a new instance of ReverseOperationProxy.



16
17
18
# File 'lib/money/money.rb', line 16

def initialize(value)
  @value = value
end

Instance Method Details

#*(other) ⇒ Object



32
33
34
# File 'lib/money/money.rb', line 32

def *(other)
  other * @value
end

#+(other) ⇒ Object



24
25
26
# File 'lib/money/money.rb', line 24

def +(other)
  other + @value
end

#-(other) ⇒ Object



28
29
30
# File 'lib/money/money.rb', line 28

def -(other)
  -(other - @value)
end

#<=>(other) ⇒ Object



20
21
22
# File 'lib/money/money.rb', line 20

def <=>(other)
  -(other <=> @value)
end