Class: Rdomino::DatabaseCollection
- Inherits:
-
Object
- Object
- Rdomino::DatabaseCollection
- Includes:
- Enumerable
- Defined in:
- lib/rdomino/database_collection.rb
Overview
Replicated
Instance Attribute Summary collapse
-
#databases ⇒ Object
readonly
Returns the value of attribute databases.
Class Method Summary collapse
Instance Method Summary collapse
- #each ⇒ Object
- #get_all_documents_by_key(view, key) ⇒ Object
-
#initialize(databases) ⇒ DatabaseCollection
constructor
A new instance of DatabaseCollection.
- #method_missing(m, *args) ⇒ Object
Constructor Details
#initialize(databases) ⇒ DatabaseCollection
Returns a new instance of DatabaseCollection.
17 18 19 |
# File 'lib/rdomino/database_collection.rb', line 17 def initialize(databases) @databases = databases end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
35 36 37 38 39 |
# File 'lib/rdomino/database_collection.rb', line 35 def method_missing(m,*args) @databases.map do |database| database.__send__(m,*args) end end |
Instance Attribute Details
#databases ⇒ Object (readonly)
Returns the value of attribute databases.
5 6 7 |
# File 'lib/rdomino/database_collection.rb', line 5 def databases @databases end |
Class Method Details
Instance Method Details
#each ⇒ Object
21 22 23 24 25 |
# File 'lib/rdomino/database_collection.rb', line 21 def each @databases.each do |database| yield database end end |
#get_all_documents_by_key(view, key) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/rdomino/database_collection.rb', line 27 def get_all_documents_by_key(view,key) @databases.each do |database| database[view].get_all_documents_by_key(key).each do|doc| yield database.server, doc end end end |