class Topographer::Importer::Logger::Base

Attributes

fatal_errors[R]

Public Class Methods

new() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 8
def initialize
  @fatal_errors = []
end

Public Instance Methods

all_entries() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 56
def all_entries
  (successes + failures + fatal_errors).sort { |a, b| a.timestamp <=> b.timestamp }
end
entries?() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 48
def entries?
  total_imports > 0
end
errors?() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 60
def errors?
  fatal_error? || failed_imports > 0
end
failed_imports() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 44
def failed_imports
  raise NotImplementedError
end
failures() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 16
def failures
  raise NotImplementedError
end
fatal_error?() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 68
def fatal_error?
  @fatal_errors.any?
end
log_failure(log_entry) click to toggle source
# File lib/topographer/importer/logger/base.rb, line 32
def log_failure(log_entry)
  raise NotImplementedError
end
log_fatal(source, message) click to toggle source
# File lib/topographer/importer/logger/base.rb, line 36
def log_fatal(source, message)
  @fatal_errors << Topographer::Importer::Logger::FatalErrorEntry.new(source, message)
end
log_import(log_entry) click to toggle source
# File lib/topographer/importer/logger/base.rb, line 20
def log_import(log_entry)
  if log_entry.success?
    log_success(log_entry)
  else
    log_failure(log_entry)
  end
end
log_success(log_entry) click to toggle source
# File lib/topographer/importer/logger/base.rb, line 28
def log_success(log_entry)
  raise NotImplementedError
end
save() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 72
def save
  raise NotImplementedError
end
success?() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 64
def success?
  !errors?
end
successes() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 12
def successes
  raise NotImplementedError
end
successful_imports() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 40
def successful_imports
  raise NotImplementedError
end
total_imports() click to toggle source
# File lib/topographer/importer/logger/base.rb, line 52
def total_imports
  (successful_imports + failed_imports)
end