Class: Topographer::Importer::Logger::LogEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/topographer/importer/logger/log_entry.rb

Direct Known Subclasses

FatalErrorEntry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_identifier, model_name, import_status) ⇒ LogEntry

Returns a new instance of LogEntry.



5
6
7
8
9
# File 'lib/topographer/importer/logger/log_entry.rb', line 5

def initialize(input_identifier, model_name, import_status)
  @input_identifier = input_identifier
  @model_name = model_name
  @import_status = import_status
end

Instance Attribute Details

#input_identifierObject (readonly)

Returns the value of attribute input_identifier.



2
3
4
# File 'lib/topographer/importer/logger/log_entry.rb', line 2

def input_identifier
  @input_identifier
end

#model_nameObject (readonly)

Returns the value of attribute model_name.



2
3
4
# File 'lib/topographer/importer/logger/log_entry.rb', line 2

def model_name
  @model_name
end

Instance Method Details

#detailsObject



23
24
25
# File 'lib/topographer/importer/logger/log_entry.rb', line 23

def details
  @import_status.errors
end

#failure?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/topographer/importer/logger/log_entry.rb', line 31

def failure?
  @import_status.errors?
end

#messageObject



15
16
17
# File 'lib/topographer/importer/logger/log_entry.rb', line 15

def message
  @import_status.message
end

#source_identifierObject



11
12
13
# File 'lib/topographer/importer/logger/log_entry.rb', line 11

def source_identifier
  @import_status.input_identifier
end

#success?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/topographer/importer/logger/log_entry.rb', line 27

def success?
  !failure?
end

#timestampObject



19
20
21
# File 'lib/topographer/importer/logger/log_entry.rb', line 19

def timestamp
  @import_status.timestamp
end