Class: Moist::Steps::Registry
- Inherits:
-
Object
- Object
- Moist::Steps::Registry
- Defined in:
- lib/moist/steps/registry.rb
Instance Method Summary collapse
- #[](val) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #register(campaign_slug, mailer_class, mailer_action, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Registry
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, = {}) @table[campaign_slug] ||= Set.new @table[campaign_slug] << Step.new(mailer_class, mailer_action, ) end |