Class: TimeLine::Job
- Inherits:
-
Object
- Object
- TimeLine::Job
- Defined in:
- lib/arbi/timeline.rb
Instance Attribute Summary collapse
-
#every ⇒ Object
Returns the value of attribute every.
-
#proc ⇒ Object
Returns the value of attribute proc.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(ev = 2, to = 5, &blk) ⇒ Job
constructor
A new instance of Job.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#every ⇒ Object
Returns the value of attribute every.
25 26 27 |
# File 'lib/arbi/timeline.rb', line 25 def every @every end |
#proc ⇒ Object
Returns the value of attribute proc.
25 26 27 |
# File 'lib/arbi/timeline.rb', line 25 def proc @proc end |
#timeout ⇒ Object
Returns the value of attribute timeout.
25 26 27 |
# File 'lib/arbi/timeline.rb', line 25 def timeout @timeout end |
Instance Method Details
#run ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/arbi/timeline.rb', line 50 def run EventMachine::PeriodicTimer.new(self.every) { ::Timeout.timeout(self.timeout) { self.proc.call } } end |