Class: IntegerTypecaster

Inherits:
Typecaster show all
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

#typeObject



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