Class: FloatTypecaster

Inherits:
Typecaster show all
Defined in:
lib/type_casters.rb

Overview

Casts a value to a float

Instance Method Summary collapse

Methods inherited from Typecaster

registered_typecasters, typecaster_for

Instance Method Details

#typeObject



40
# File 'lib/type_casters.rb', line 40

def type; 'float' end

#typecast(value) ⇒ Object



42
43
44
# File 'lib/type_casters.rb', line 42

def typecast(value)
  value.to_f
end