Module: SimplyCouch::Model::Database

Included in:
ClassMethods
Defined in:
lib/simply_couch/model/database.rb

Instance Method Summary collapse

Instance Method Details

#couchrest_database_urlObject

Override this to provide a custom database URL. In Rails, reads config/couchdb.yml automatically.



10
11
12
# File 'lib/simply_couch/model/database.rb', line 10

def couchrest_database_url
  @_couchrest_database_url || detect_couchdb_url || ENV['COUCHDB_URL'] || 'http://127.0.0.1:5984'
end

#couchrest_database_url=(url) ⇒ Object



14
15
16
# File 'lib/simply_couch/model/database.rb', line 14

def couchrest_database_url=(url)
  @_couchrest_database_url = url
end

#databaseObject



4
5
6
# File 'lib/simply_couch/model/database.rb', line 4

def database
  @_simply_couch_database ||= DatabaseInstance.new(full_database_url)
end