Module: Mongoid::Extensions::Integer::Conversions
- Included in:
- Integer
- Defined in:
- lib/mongoid/extensions/integer/conversions.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#cast(value) ⇒ Object
5 6 7 |
# File 'lib/mongoid/extensions/integer/conversions.rb', line 5 def cast(value) value =~ /\d/ ? value.to_i : value end |