Method: MongoModel::Types::Hash#to_mongo

Defined in:
lib/mongomodel/support/types/hash.rb

#to_mongo(hash) ⇒ Object



6
7
8
9
10
11
# File 'lib/mongomodel/support/types/hash.rb', line 6

def to_mongo(hash)
  hash.inject({}) { |result, (k, v)|
    result[convert(k)] = convert(v)
    result
  } if hash
end