Class: Jsm::Callbacks::ChainCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/jsm/callbacks/chain_collection.rb

Overview

collection of chain

Instance Method Summary collapse

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