Method: Moneta::Defaults#update
- Defined in:
- lib/moneta/mixins.rb
#merge!(pairs, options = {}) ⇒ self #merge!(pairs, options = {}) {|key, old_value, new_value| ... } ⇒ self
Note:
Some adapters may implement this method atomically, or in two passes when a block is provided. The default implmentation uses #key?, #load and #store.
Stores the pairs in the key-value store, and returns itself. When a block is provided, it will be called before overwriting any existing values with the key, old value and supplied value, and the return value of the block will be used in place of the supplied value.
352 353 354 |
# File 'lib/moneta/mixins.rb', line 352 def update(pairs, = {}, &block) merge!(pairs, , &block) end |