Module: CouchClient

Defined in:
lib/couch-client.rb,
lib/couch-client/row.rb,
lib/couch-client/design.rb,
lib/couch-client/hookup.rb,
lib/couch-client/database.rb,
lib/couch-client/document.rb,
lib/couch-client/rake_task.rb,
lib/couch-client/attachment.rb,
lib/couch-client/collection.rb,
lib/couch-client/connection.rb,
lib/couch-client/attachment_list.rb,
lib/couch-client/consistent_hash.rb,
lib/couch-client/connection_handler.rb

Overview

The CouchClient module is the overall container of all CouchClient logic.

Defined Under Namespace

Classes: Attachment, AttachmentError, AttachmentList, AttachmentNotFound, Collection, Connection, ConnectionFailed, ConnectionHandler, ConsistentHash, Database, DatabaseNotGiven, Design, Document, DocumentNotAvailable, DocumentNotFound, DocumentNotValid, Error, FullTextNotFound, FullTextRequestBad, Hookup, InvalidDatabaseName, InvalidHTTPVerb, InvalidId, InvalidJSONData, InvalidPathObject, InvalidQueryObject, ListNotFound, RakeTask, Row, ShowNotFound, ViewNotFound

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.connect(args = {}, &block) ⇒ Object

Start using CouchClient by constructing a new CouchClient::Connection object with a Hash:

CouchClient.connect(:database => "db_name")

with a block:

CouchClient.connect do |c|
  c.database = "db_name"
end

or with both:

CouchClient.connect(:username => "user", :password => "pass") do |c|
  c.database = "db_name"
end

CouchClient.connect takes the following options.

scheme: Protocol used (e.g. http or https), default being "http".
username: Username used by HTTP Basic authentication.
password: Password used by HTTP Basic authentication.
host: The domain for your CouchDB erver, default being "localhost".
port: The port for your CouchDB server, default being 5984.
database: The database you wish to connect to.


46
47
48
# File 'lib/couch-client.rb', line 46

def self.connect(args = {}, &block)
  Connection.new(args, &block)
end