Class: AbstractImporter::Reporters::BaseReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/abstract_importer/reporters/base_reporter.rb

Direct Known Subclasses

DebugReporter, NullReporter, PerformanceReporter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ BaseReporter

Returns a new instance of BaseReporter.



6
7
8
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 6

def initialize(io)
  @io = io
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



4
5
6
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 4

def io
  @io
end

Instance Method Details

#count_error(message) ⇒ Object



44
45
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 44

def count_error(message)
end

#count_notice(message) ⇒ Object



41
42
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 41

def count_notice(message)
end

#finish_all(importer, ms) ⇒ Object



16
17
18
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 16

def finish_all(importer, ms)
  io.puts "\n\nFinished in #{distance_of_time(ms)}"
end

#finish_collection(collection, summary) ⇒ Object



28
29
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 28

def finish_collection(collection, summary)
end

#finish_setup(ms) ⇒ Object



20
21
22
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 20

def finish_setup(ms)
  io.puts "Setup took #{distance_of_time(ms)}\n"
end

#record_created(record) ⇒ Object



33
34
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 33

def record_created(record)
end

#record_failed(record, hash) ⇒ Object



36
37
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 36

def record_failed(record, hash)
end

#start_all(importer) ⇒ Object



12
13
14
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 12

def start_all(importer)
  io.puts "Importing #{importer.describe_source} to #{importer.describe_destination}\n"
end

#start_collection(collection) ⇒ Object



24
25
26
# File 'lib/abstract_importer/reporters/base_reporter.rb', line 24

def start_collection(collection)
  io.puts "\n#{("="*80)}\nImporting #{collection.name}\n#{("="*80)}\n"
end