Method: CouchClient::Document#saved_doc

Defined in:
lib/couch-client/document.rb

#saved_doc(query = {}) ⇒ Object

Returns a copy of the same document that is currently saved on the server.



43
44
45
46
47
48
49
# File 'lib/couch-client/document.rb', line 43

def saved_doc(query = {})
  if new?
    raise DocumentNotAvailable.new("this document is new and therefore has not been saved yet")
  else
    @connection[self.id, query]
  end
end