Module: SimplyCouch::Model::Database
- Included in:
- ClassMethods
- Defined in:
- lib/simply_couch/model/database.rb
Instance Method Summary collapse
-
#couchrest_database_url ⇒ Object
Override this to provide a custom database URL.
- #couchrest_database_url=(url) ⇒ Object
- #database ⇒ Object
Instance Method Details
#couchrest_database_url ⇒ Object
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 |
#database ⇒ Object
4 5 6 |
# File 'lib/simply_couch/model/database.rb', line 4 def database @_simply_couch_database ||= DatabaseInstance.new(full_database_url) end |