Class: Money::Arithmetic::CoercedNumeric

Inherits:
Struct
  • Object
show all
Defined in:
lib/money/money/arithmetic.rb

Overview

Wrapper for coerced numeric values to distinguish when numeric was on the 1st place in operation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



5
6
7
# File 'lib/money/money/arithmetic.rb', line 5

def value
  @value
end

Instance Method Details

#zero?Boolean

Proxy #zero? method to skip unnecessary typecasts. See #- and #+.

Returns:

  • (Boolean)


7
8
9
# File 'lib/money/money/arithmetic.rb', line 7

def zero?
  value.zero?
end