Class Coercible::Coercer::Float
In: lib/coercible/coercer/float.rb
Parent: Numeric

Coerce Float values

Methods

Public Instance methods

Coerce given value to a DateTime

@example

  datetime = Coercible::Coercion::Float.to_datetime(1000000000.999)  # => Sun, 09 Sep 2001 01:46:40 +0000
  datetime.to_f  # => 1000000000.999

@param [Float] value

@return [DateTime]

@api public

Passthrough the value

@example

  coercer[Float].to_float(1.0)  # => 1.0

@param [Float] value

@return [Integer]

@api public

[Validate]