Method: Cooler::Model::ClassMethods#get!
- Defined in:
- lib/cooler/model.rb
#get!(key) ⇒ Object
Gets an Object from Couchbase, and construct an instance by its key. Raises an error if not found.
key - The String that contains the key to query the object.
Return a Model instance. Raises Cooler::KeyNotFound if not found. Compatible with Sinatra::NotFound; www.sinatrarb.com/intro.html#Not%20Found
112 113 114 |
# File 'lib/cooler/model.rb', line 112 def get!(key) get(key) || raise(Cooler::KeyNotFound) end |