Class: Riagent::Persistence::RiakNoIndexStrategy
- Inherits:
-
RiakKVStrategy
- Object
- PersistenceStrategy
- RiakKVStrategy
- Riagent::Persistence::RiakNoIndexStrategy
- Defined in:
- lib/riagent/persistence/riak_no_index_strategy.rb
Instance Attribute Summary
Attributes inherited from RiakKVStrategy
Attributes inherited from PersistenceStrategy
#client, #collection_name, #model_class
Instance Method Summary collapse
-
#all(results_limit) ⇒ Array<Riagent::ActiveDocument>
Return all the documents in the collection.
Methods inherited from RiakKVStrategy
#allows_query?, #client, #find, #from_riak_object, #insert, #new_riak_object, #remove, #update
Methods inherited from PersistenceStrategy
Constructor Details
This class inherits a constructor from Riagent::Persistence::PersistenceStrategy
Instance Method Details
#all(results_limit) ⇒ Array<Riagent::ActiveDocument>
Return all the documents in the collection. Since this is a “no index” strategy, this can only be done via a streaming list keys
31 32 33 34 35 36 |
# File 'lib/riagent/persistence/riak_no_index_strategy.rb', line 31 def all(results_limit) self.bucket.keys.inject([]) do |acc, k| obj = self.find(k) obj ? acc << obj : acc end end |