Class: TheShoveler::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/theShoveler/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, count) ⇒ Job

Returns a new instance of Job.



5
6
7
8
# File 'lib/theShoveler/job.rb', line 5

def initialize(target, count)
  @target = target
  @count = count
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



4
5
6
# File 'lib/theShoveler/job.rb', line 4

def count
  @count
end

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/theShoveler/job.rb', line 3

def target
  @target
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
# File 'lib/theShoveler/job.rb', line 10

def run
  TheShoveler::logger.info 'pushing docs'
  puts count
  @count.times do |c|
    @target.add Document.new
    puts '.'
  end
end