Class: Moist::Steps::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/moist/steps/registry.rb

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



6
7
8
# File 'lib/moist/steps/registry.rb', line 6

def initialize
  @table = Hash.new
end

Instance Method Details

#[](val) ⇒ Object



15
16
17
# File 'lib/moist/steps/registry.rb', line 15

def [](val)
  @table[val] || []
end

#register(campaign_slug, mailer_class, mailer_action, options = {}) ⇒ Object



10
11
12
13
# File 'lib/moist/steps/registry.rb', line 10

def register(campaign_slug, mailer_class, mailer_action, options = {})
  @table[campaign_slug] ||= Set.new
  @table[campaign_slug] << Step.new(mailer_class, mailer_action, options)
end