Class: Couch::Server

Inherits:
Object show all
Includes:
Log
Defined in:
lib/couch/server.rb

Constant Summary

Constants included from Log

Log::QUIET

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ Server

Returns a new instance of Server.



8
9
10
# File 'lib/couch/server.rb', line 8

def initialize(host, port)
  @host, @port = host, port
end

Instance Method Details

#delete(uri) ⇒ Object



12
# File 'lib/couch/server.rb', line 12

def delete(uri);      request Net::HTTP::Delete.new(uri); end

#get(uri) ⇒ Object



13
# File 'lib/couch/server.rb', line 13

def get(uri);         request Net::HTTP::Get.new(uri); end

#post(uri, json) ⇒ Object



15
# File 'lib/couch/server.rb', line 15

def post(uri, json);  request Net::HTTP::Post.new(uri), json; end

#put(uri, json) ⇒ Object



14
# File 'lib/couch/server.rb', line 14

def put(uri, json);   request Net::HTTP::Put.new(uri), json; end