Class: Integer

Inherits:
Object show all
Defined in:
lib/more/typecast.rb

Class Method Summary collapse

Class Method Details

.cast_from(object) ⇒ Object



164
165
166
167
168
169
# File 'lib/more/typecast.rb', line 164

def cast_from(object)
  return super
rescue TypeCastException
  return object.to_i if object.respond_to? :to_i
  raise
end