Module: Couchbase::Operations::Fetch
- Defined in:
- lib/couchbase/operations/fetch.rb
Instance Method Summary collapse
Instance Method Details
#fetch(key, set_options = {}, get_options = {}, &block) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/couchbase/operations/fetch.rb', line 23 def fetch(key, = {}, = {}, &block) fail ArgumentError 'Must pass a block to #fetch' unless block_given? [:quiet] = false get(key, ) rescue Couchbase::Error::NotFound yield(block).tap {|value| set(key, value, ) } end |