Class: HashWithIndifferentAccess

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



260
261
262
# File 'lib/mongo_odm/core_ext/conversions.rb', line 260

def self.type_cast(value)
  Hash.type_cast(value).with_indifferent_access
end

Instance Method Details

#to_mongoObject



264
265
266
# File 'lib/mongo_odm/core_ext/conversions.rb', line 264

def to_mongo
  Hash[self.map{|k,v| [k.to_mongo, v.to_mongo]}]
end