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



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

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

#get_doc(database, id) ⇒ Object

Returns parsed doc from database



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

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