Module: CouchDB

Defined in:
lib/couchdb.rb,
lib/couchdb/model.rb,
lib/couchdb/client.rb,
lib/couchdb/errors.rb,
lib/couchdb/database.rb,
lib/couchdb/document.rb,
lib/couchdb/json_object.rb,
lib/couchdb/client/version.rb

Defined Under Namespace

Classes: Client, DataBase, Document, Error, HTTPError, InvalidObject, InvalidOperation, InvalidValue, JSONObject, MissingProperty, Model, PropertyError, UndefinedProperty

Class Method Summary collapse

Class Method Details

.connect(options = {}) ⇒ Object

Public: A sugar method for creating a Client instance.



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

def connect(options = {})
  Client.new options
end

.debugObject



31
32
33
# File 'lib/couchdb.rb', line 31

def debug
  logger.debug yield if logger.debug?
end

.loggerObject



20
21
22
23
24
25
# File 'lib/couchdb.rb', line 20

def logger
  @logger ||= begin
                require 'logger'
                Logger.new($stdout).tap { |logger| logger.level = $DEBUG ? Logger::DEBUG : Logger::INFO }
              end
end

.logger=(logger) ⇒ Object



27
28
29
# File 'lib/couchdb.rb', line 27

def logger=(logger)
  @logger = logger
end