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



90
91
92
93
# File 'lib/couch.rb', line 90

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



85
86
87
88
# File 'lib/couch.rb', line 85

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