Class: Hash

Inherits:
Object show all
Includes:
MongoHash
Defined in:
lib/mongo_persist/util.rb,
lib/mongo_persist/hash_ext.rb

Instance Method Summary collapse

Methods included from MongoHash

#can_mongo_convert?, #get_mongo_id, #mongo_class, #naked_reference?, #to_mongo_hash, #to_mongo_hash_for_obj, #to_mongo_object

Instance Method Details

#map_keyObject



59
60
61
62
63
# File 'lib/mongo_persist/util.rb', line 59

def map_key
  res = {}
  each { |k,v| res[yield(k)] = v }
  res
end

#map_valueObject



54
55
56
57
58
# File 'lib/mongo_persist/util.rb', line 54

def map_value
  res = {}
  each { |k,v| res[k] = yield(v) }
  res
end