Class: Hireling::Schedule
- Inherits:
-
Object
- Object
- Hireling::Schedule
- Defined in:
- lib/hireling/hireling.rb
Instance Method Summary collapse
- #[](hireling_name) ⇒ Object
-
#initialize ⇒ Schedule
constructor
A new instance of Schedule.
- #schedule(rufus_scheduler, hireling) ⇒ Object
Constructor Details
#initialize ⇒ Schedule
Returns a new instance of Schedule.
49 50 51 |
# File 'lib/hireling/hireling.rb', line 49 def initialize @proxies = {} end |
Instance Method Details
#[](hireling_name) ⇒ Object
52 53 54 |
# File 'lib/hireling/hireling.rb', line 52 def [](hireling_name) @proxies[hireling_name] = SchedulerProxy.new end |
#schedule(rufus_scheduler, hireling) ⇒ Object
56 57 58 59 60 |
# File 'lib/hireling/hireling.rb', line 56 def schedule(rufus_scheduler, hireling) proxy = @proxies[hireling.class.name.underscore.to_sym] raise "No schedule found for #{hireling.class.name.underscore.to_sym}" unless proxy proxy.replay(rufus_scheduler,hireling) end |