class Topographer::Importer::Logger::LogEntry

A log entry from an import. Each row imported produces an entry, regardless of status.

@!attribute input_identifier [r]

@return [String] the identifier of the input (e.g. the name of the spreadsheet being imported)

@!attribute model_name [r]

@return [String] the name of the model class being imported for the log entry

Attributes

input_identifier[R]
model_name[R]

Public Class Methods

new(input_identifier, model_name, import_status) click to toggle source
# File lib/topographer/importer/logger/log_entry.rb, line 14
def initialize(input_identifier, model_name, import_status)
  @input_identifier = input_identifier
  @model_name = model_name
  @import_status = import_status
end

Public Instance Methods

details() click to toggle source

@return [Hash] a hash of the error details that occurred during the import

# File lib/topographer/importer/logger/log_entry.rb, line 36
def details
  @import_status.errors
end
failure?() click to toggle source

@return [Boolean] true if there are errors

# File lib/topographer/importer/logger/log_entry.rb, line 46
def failure?
  @import_status.errors?
end
message() click to toggle source

@return [String] the message associated with the log entry

# File lib/topographer/importer/logger/log_entry.rb, line 26
def message
  @import_status.message
end
source_identifier() click to toggle source

@return [String] the identifier of the input row the entry is for

# File lib/topographer/importer/logger/log_entry.rb, line 21
def source_identifier
  @import_status.input_identifier
end
success?() click to toggle source

@return [Boolean] true if there are no errors

# File lib/topographer/importer/logger/log_entry.rb, line 41
def success?
  !failure?
end
timestamp() click to toggle source

@return [DateTime] the time that the logged event occurred

# File lib/topographer/importer/logger/log_entry.rb, line 31
def timestamp
  @import_status.timestamp
end