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.



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

def initialize(value)
  @value = value
end

Instance Method Details

#*(other) ⇒ Object



35
36
37
# File 'lib/money/money.rb', line 35

def *(other)
  other * @value
end

#+(other) ⇒ Object



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

def +(other)
  other + @value
end

#-(other) ⇒ Object



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

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

#<=>(other) ⇒ Object



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

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