Class: Mongoid::CachedJson::KeyReferences
- Inherits:
-
Hash
- Object
- Hash
- Mongoid::CachedJson::KeyReferences
show all
- Defined in:
- lib/mongoid-cached-json/key_references.rb
Instance Method Summary
collapse
Methods inherited from Hash
#as_json, #as_json_partial
Instance Method Details
#merge_set(keys) ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/mongoid-cached-json/key_references.rb', line 6
def merge_set(keys)
if keys
keys.each_pair do |k, jsons|
self[k] ||= []
self[k].concat(jsons)
end
end
self
end
|
#set_and_add(key, json) ⇒ Object
16
17
18
19
20
|
# File 'lib/mongoid-cached-json/key_references.rb', line 16
def set_and_add(key, json)
self[key] ||= []
self[key] << json
self
end
|