Class: FloatTypecaster
- Inherits:
-
Typecaster
- Object
- Typecaster
- FloatTypecaster
- Defined in:
- lib/type_casters.rb
Overview
Casts a value to a float
Instance Method Summary collapse
Methods inherited from Typecaster
registered_typecasters, #typecast_on_write?, typecaster_for
Instance Method Details
#type ⇒ Object
46 |
# File 'lib/type_casters.rb', line 46 def type; 'float' end |
#typecast(value) ⇒ Object
48 49 50 |
# File 'lib/type_casters.rb', line 48 def typecast(value) value.to_f end |