Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_odm/core_ext/conversions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.type_cast(value) ⇒ Object



101
102
103
104
# File 'lib/mongo_odm/core_ext/conversions.rb', line 101

def self.type_cast(value)
  return nil if value.nil?
  value.to_i
end

Instance Method Details

#to_mongoObject



106
107
108
# File 'lib/mongo_odm/core_ext/conversions.rb', line 106

def to_mongo
  self
end