Class: CouchDB::Server

Inherits:
Object
  • Object
show all
Includes:
Rest::Resource
Defined in:
lib/couchdb.rb

Instance Method Summary collapse

Methods included from Rest::Resource

#delete, #get, #post, #put

Constructor Details

#initialize(host = "localhost", port = 5984) ⇒ Server

Returns a new instance of Server.



11
12
13
14
# File 'lib/couchdb.rb', line 11

def initialize(host="localhost", port=5984)
  @host = host
  @port = port
end

Instance Method Details

#databasesObject



16
17
18
19
# File 'lib/couchdb.rb', line 16

def databases
  response = self.get "/_all_dbs"
  JSON.parse(response.body).map { |name| Database.new(self, name) }
end