Class: Rounders::Handlers::Handler
- Inherits:
-
Object
- Object
- Rounders::Handlers::Handler
- Includes:
- Plugins::Pluggable, Topping::Configurable::Branch
- Defined in:
- lib/rounders/handlers/handler.rb
Defined Under Namespace
Classes: Dispatcher
Instance Attribute Summary collapse
-
#matches ⇒ Object
readonly
Returns the value of attribute matches.
-
#rounder ⇒ Object
readonly
Returns the value of attribute rounder.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rounder, matches) ⇒ Handler
constructor
A new instance of Handler.
Methods included from Plugins::Pluggable
Constructor Details
#initialize(rounder, matches) ⇒ Handler
Returns a new instance of Handler.
45 46 47 48 |
# File 'lib/rounders/handlers/handler.rb', line 45 def initialize(rounder, matches) @rounder = rounder @matches = matches end |
Instance Attribute Details
#matches ⇒ Object (readonly)
Returns the value of attribute matches.
6 7 8 |
# File 'lib/rounders/handlers/handler.rb', line 6 def matches @matches end |
#rounder ⇒ Object (readonly)
Returns the value of attribute rounder.
6 7 8 |
# File 'lib/rounders/handlers/handler.rb', line 6 def rounder @rounder end |
Class Method Details
.dispatch(rounder, mails) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/rounders/handlers/handler.rb', line 23 def dispatch(rounder, mails) mails.map do |mail| dispatchers.each do |dispatcher| matches = dispatcher.matcher.match(mail) next if matches.nil? new(rounder, matches).public_send(dispatcher.method_name, mail) end end end |