Module: Origin::Extensions::BigDecimal::ClassMethods

Defined in:
lib/origin/extensions/big_decimal.rb

Instance Method Summary collapse

Instance Method Details

#evolve(object) ⇒ String

Evolves the big decimal into a MongoDB friendly value - in this case a string.

Examples:

Evolve the big decimal

BigDecimal.evolve(decimal)

Parameters:

Returns:

  • (String)

    The big decimal as a string.

Since:

  • 1.0.0



23
24
25
26
27
# File 'lib/origin/extensions/big_decimal.rb', line 23

def evolve(object)
  __evolve__(object) do |obj|
    obj ? obj.to_s : obj
  end
end