Class: Clockwork::DatabaseEvents::Event
- Defined in:
- lib/clockwork/database_events/event.rb
Instance Attribute Summary collapse
-
#at ⇒ Object
Returns the value of attribute at.
-
#event_store ⇒ Object
Returns the value of attribute event_store.
Attributes inherited from Event
Instance Method Summary collapse
- #frequency ⇒ Object
-
#initialize(manager, period, job, block, event_store, options = {}) ⇒ Event
constructor
A new instance of Event.
- #job_has_name? ⇒ Boolean
- #name ⇒ Object
- #to_s ⇒ Object
Methods inherited from Event
#convert_timezone, #run, #run_now?, #thread?
Constructor Details
#initialize(manager, period, job, block, event_store, options = {}) ⇒ Event
Returns a new instance of Event.
9 10 11 12 13 |
# File 'lib/clockwork/database_events/event.rb', line 9 def initialize(manager, period, job, block, event_store, ={}) super(manager, period, job, block, ) @event_store = event_store @event_store.register(self, job) end |
Instance Attribute Details
#at ⇒ Object
Returns the value of attribute at.
7 8 9 |
# File 'lib/clockwork/database_events/event.rb', line 7 def at @at end |
#event_store ⇒ Object
Returns the value of attribute event_store.
7 8 9 |
# File 'lib/clockwork/database_events/event.rb', line 7 def event_store @event_store end |
Instance Method Details
#frequency ⇒ Object
27 28 29 |
# File 'lib/clockwork/database_events/event.rb', line 27 def frequency @period end |
#job_has_name? ⇒ Boolean
19 20 21 |
# File 'lib/clockwork/database_events/event.rb', line 19 def job_has_name? job.respond_to?(:name) end |
#name ⇒ Object
15 16 17 |
# File 'lib/clockwork/database_events/event.rb', line 15 def name (job_has_name? && job.name) ? job.name : "#{job.class}:#{job.id}" end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/clockwork/database_events/event.rb', line 23 def to_s name end |