Parent

Coercible::Coercer::Decimal

Coerce BigDecimal values

Constants

FLOAT_FORMAT

Public Instance Methods

to_decimal(value) click to toggle source

Passthrough the value

@example

Coercible::Coercion::BigDecimal.to_decimal(BigDecimal('1.0')) # => BigDecimal('1.0')

@param [BigDecimal] value

@return [Fixnum]

@api public

# File lib/coercible/coercer/decimal.rb, line 34
def to_decimal(value)
  value
end
to_string(value) click to toggle source

Coerce given value to String

@example

coercer[BigDecimal].to_string(BigDecimal('1.0')) # => "1.0"

@param [BigDecimal] value

@return [String]

@api public

# File lib/coercible/coercer/decimal.rb, line 20
def to_string(value)
  value.to_s(FLOAT_FORMAT)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.