Class: IntegerTypecaster
- Inherits:
-
Typecaster
- Object
- Typecaster
- IntegerTypecaster
- Defined in:
- lib/type_casters.rb
Overview
Casts a value to an integer
Instance Method Summary collapse
Methods inherited from Typecaster
registered_typecasters, typecaster_for
Instance Method Details
#type ⇒ Object
31 |
# File 'lib/type_casters.rb', line 31 def type; 'integer' end |
#typecast(value) ⇒ Object
33 34 35 |
# File 'lib/type_casters.rb', line 33 def typecast(value) value.to_i end |