Class: PureForm::Types::IntegerType

Inherits:
BaseType
  • Object
show all
Defined in:
lib/pure_form/types/integer.rb

Instance Method Summary collapse

Methods inherited from BaseType

#initialize

Constructor Details

This class inherits a constructor from PureForm::Types::BaseType

Instance Method Details

#typecast(value) ⇒ Object



4
5
6
7
8
# File 'lib/pure_form/types/integer.rb', line 4

def typecast(value)
  value.blank?? nil : value.to_i
rescue NoMethodError
  nil
end