Class: Jsm::Callbacks::ChainCollection
- Inherits:
-
Object
- Object
- Jsm::Callbacks::ChainCollection
- Defined in:
- lib/jsm/callbacks/chain_collection.rb
Overview
collection of chain
Instance Method Summary collapse
- #[](context) ⇒ Object
- #add_chain(context, chain) ⇒ Object
-
#initialize(klass) ⇒ ChainCollection
constructor
A new instance of ChainCollection.
Constructor Details
#initialize(klass) ⇒ ChainCollection
Returns a new instance of ChainCollection.
3 4 5 6 |
# File 'lib/jsm/callbacks/chain_collection.rb', line 3 def initialize(klass) @klass = klass @chains = {} end |
Instance Method Details
#[](context) ⇒ Object
12 13 14 |
# File 'lib/jsm/callbacks/chain_collection.rb', line 12 def [](context) @chains[context] ||= Jsm::Callbacks::Chain.new(context) end |
#add_chain(context, chain) ⇒ Object
8 9 10 |
# File 'lib/jsm/callbacks/chain_collection.rb', line 8 def add_chain(context,chain) @chains[context] = chain end |