Class: Moist::MailerRegistry
- Inherits:
-
Object
- Object
- Moist::MailerRegistry
- Defined in:
- lib/moist/mailer_registry.rb
Instance Method Summary collapse
- #[](val) ⇒ Object
- #enabled?(klass, action) ⇒ Boolean
-
#initialize ⇒ MailerRegistry
constructor
A new instance of MailerRegistry.
- #register(mailer, action) ⇒ Object
Constructor Details
#initialize ⇒ MailerRegistry
Returns a new instance of MailerRegistry.
3 4 5 |
# File 'lib/moist/mailer_registry.rb', line 3 def initialize @table = Hash.new end |
Instance Method Details
#[](val) ⇒ Object
12 13 14 |
# File 'lib/moist/mailer_registry.rb', line 12 def [](val) @table[val] end |
#enabled?(klass, action) ⇒ Boolean
16 17 18 |
# File 'lib/moist/mailer_registry.rb', line 16 def enabled?(klass, action) @table[klass] && @table[klass].include?(action) end |
#register(mailer, action) ⇒ Object
7 8 9 10 |
# File 'lib/moist/mailer_registry.rb', line 7 def register(mailer, action) @table[mailer] ||= Set.new @table[mailer] << action.to_s end |