Class: Virtus::Coercion::Float

Inherits:
Numeric show all
Defined in:
lib/virtus/coercion/float.rb

Overview

Coerce Float values

Constant Summary

Constants inherited from Object

Object::COERCION_METHOD_REGEXP

Constants included from TypeLookup

TypeLookup::EXTRA_CONST_ARGS, TypeLookup::TYPE_FORMAT

Class Method Summary collapse

Methods inherited from Numeric

to_decimal, to_integer, to_string

Methods inherited from Object

method_missing

Methods inherited from Virtus::Coercion

[]

Methods included from DescendantsTracker

#add_descendant, #descendants

Methods included from TypeLookup

#determine_type, #primitive

Methods included from Options

#accept_options, #accepted_options, #options

Class Method Details

.to_float(value) ⇒ Integer

Passthrough the value

Examples:

Virtus::Coercion::Float.to_float(1.0)  # => 1.0

Parameters:

Returns:



18
19
20
# File 'lib/virtus/coercion/float.rb', line 18

def self.to_float(value)
  value
end