Class: Ruote::Resque::ParticipantRegistrar
- Inherits:
-
Object
- Object
- Ruote::Resque::ParticipantRegistrar
- Defined in:
- lib/ruote/resque/participant_registrar.rb
Overview
An object to easy Participant registration
Instance Method Summary collapse
- #initialize(dashboard) ⇒ Ruote::Resque::ParticipantRegistrar constructor
-
#method_missing(method_name, *args, &block) ⇒ Object
Implements the dsl to register participants.
-
#participant(name, klass, queue, options = {}) ⇒ void
Call this method to register a participant (or use method_missing).
Constructor Details
#initialize(dashboard) ⇒ Ruote::Resque::ParticipantRegistrar
19 20 21 |
# File 'lib/ruote/resque/participant_registrar.rb', line 19 def initialize(dashboard) @dashboard = dashboard end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
Implements the dsl to register participants
25 26 27 |
# File 'lib/ruote/resque/participant_registrar.rb', line 25 def method_missing(method_name, *args, &block) participant(method_name.to_s, *args, &block) end |
Instance Method Details
#participant(name, klass, queue, options = {}) ⇒ void
This method returns an undefined value.
Call this method to register a participant (or use method_missing)
35 36 37 38 |
# File 'lib/ruote/resque/participant_registrar.rb', line 35 def participant(name, klass, queue, = {}) .merge!({ :class => klass, :queue => queue }) @dashboard.register_participant(name, Ruote::Resque::Participant, ) end |