Class: Leftovers::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/leftovers/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#reporter=(value) ⇒ Object

Sets the attribute reporter

Parameters:

  • value

    the value to set the attribute reporter to.



5
6
7
# File 'lib/leftovers/runner.rb', line 5

def reporter=(value)
  @reporter = value
end

Instance Method Details

#collectionObject



22
23
24
25
26
27
28
# File 'lib/leftovers/runner.rb', line 22

def collection
  @collection ||= begin
    collector.collect

    collector.collection
  end
end

#parallel=(value) ⇒ Object



14
15
16
# File 'lib/leftovers/runner.rb', line 14

def parallel=(value)
  collector.parallel = value
end

#progress=(value) ⇒ Object



18
19
20
# File 'lib/leftovers/runner.rb', line 18

def progress=(value)
  collector.progress = value
end

#runObject



7
8
9
10
11
12
# File 'lib/leftovers/runner.rb', line 7

def run
  reporter.prepare
  return reporter.report_success if collection.empty?

  reporter.report(collection)
end