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

#get(value) ⇒ Object



9
10
11
# File 'lib/mongoid/extensions/integer/conversions.rb', line 9

def get(value)
  value
end

#set(value) ⇒ Object



6
7
8
# File 'lib/mongoid/extensions/integer/conversions.rb', line 6

def set(value)
  value =~ /\d/ ? value.to_i : value
end