Module: Couch::BasicRequest::Get

Included in:
Server
Defined in:
lib/couch.rb

Instance Method Summary collapse

Instance Method Details

#get_attachment_str(db, id, attachment) ⇒ Object



39
40
41
42
# File 'lib/couch.rb', line 39

def get_attachment_str(db, id, attachment)
  uri = URI::encode "/#{db}/#{id}/#{attachment}"
  get(uri).body
end

#get_doc(database, id, params = {}) ⇒ Object

Returns parsed doc from database



34
35
36
37
# File 'lib/couch.rb', line 34

def get_doc(database, id, params={})
  res = get("/#{database}/#{CGI.escape(id)}#{create_postfix(params)}")
  JSON.parse(res.body)
end