Class: Epi::Daemon::Responders::Job
- Inherits:
-
Epi::Daemon::Responder
- Object
- Epi::Daemon::Responder
- Epi::Daemon::Responders::Job
- Defined in:
- lib/epi/daemon/responders/job.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#instruction ⇒ Object
Returns the value of attribute instruction.
Attributes inherited from Epi::Daemon::Responder
Instance Method Summary collapse
Methods inherited from Epi::Daemon::Responder
#done, #initialize, #logger, #puts, run
Constructor Details
This class inherits a constructor from Epi::Daemon::Responder
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/epi/daemon/responders/job.rb', line 6 def id @id end |
#instruction ⇒ Object
Returns the value of attribute instruction.
6 7 8 |
# File 'lib/epi/daemon/responders/job.rb', line 6 def instruction @instruction end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/epi/daemon/responders/job.rb', line 8 def run Jobs.beat! raise Exceptions::Fatal, 'Unknown job ID' unless Epi::Job === job case instruction when /^\d+$/ then set instruction.to_i when /^(\d+ )?(more|less)$/ then __send__ $2, ($1 || 1).to_i else __send__ instruction end end |