Class: GHArchive::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/gh-archive/job.rb

Instance Method Summary collapse

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

Raises:

  • (GHAException)


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

#startObject



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