Class: Stellr::Collections::MultiCollection

Inherits:
SearchableCollection show all
Defined in:
lib/stellr/collections/multi_collection.rb

Instance Attribute Summary

Attributes inherited from Base

#logger, #name

Instance Method Summary collapse

Methods inherited from SearchableCollection

#close, #highlight, #on_shutdown, #search, #size

Methods inherited from Base

#batch_finished, #close, create, #on_shutdown

Methods included from Utils::Observable

#add_listener, #listeners, #notify_listeners

Methods included from Utils::Shutdown

#shutdown, #shutting_down?

Constructor Details

#initialize(name, collections, options = {}) ⇒ MultiCollection

Returns a new instance of MultiCollection.



7
8
9
10
11
12
13
14
15
16
# File 'lib/stellr/collections/multi_collection.rb', line 7

def initialize( name, collections, options = {} )
  super name, options
  @collections = {}
  collections.each do |collection|
    @collections[collection.name] = collection
    collection.add_listener do |event|
      handle_event(collection.name, event)
    end
  end
end