Class: GHArchive::Job
- Inherits:
-
Object
- Object
- GHArchive::Job
- Defined in:
- lib/gh-archive/job.rb
Instance Method Summary collapse
-
#initialize(provider, from, to) ⇒ Job
constructor
A new instance of Job.
- #run(event, time) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(provider, from, to) ⇒ Job
Returns a new instance of Job.
6 7 8 9 10 |
# File 'lib/gh-archive/job.rb', line 6 def initialize(provider, from, to) @provider = provider @from = from @to = to end |
Instance Method Details
#run(event, time) ⇒ Object
18 19 20 |
# File 'lib/gh-archive/job.rb', line 18 def run(event, time) raise GHAException, "This is an abstract job, it should be implemented before running" end |
#start ⇒ Object
12 13 14 15 16 |
# File 'lib/gh-archive/job.rb', line 12 def start @provider.each(@from, @to) do |event, time| run(event, time) end end |