Class: Topographer::Importer::Strategy::ImportStatus
- Inherits:
-
Object
- Object
- Topographer::Importer::Strategy::ImportStatus
- Defined in:
- lib/topographer/importer/strategy/import_status.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#input_identifier ⇒ Object
readonly
Returns the value of attribute input_identifier.
-
#message ⇒ Object
Returns the value of attribute message.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #add_error(error_source, error) ⇒ Object
- #error_count ⇒ Object
- #errors? ⇒ Boolean
-
#initialize(input_identifier) ⇒ ImportStatus
constructor
A new instance of ImportStatus.
- #set_timestamp ⇒ Object
Constructor Details
#initialize(input_identifier) ⇒ ImportStatus
Returns a new instance of ImportStatus.
5 6 7 8 9 10 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 5 def initialize(input_identifier) @input_identifier = input_identifier @errors = {mapping: [], validation: []} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
2 3 4 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 2 def errors @errors end |
#input_identifier ⇒ Object (readonly)
Returns the value of attribute input_identifier.
2 3 4 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 2 def input_identifier @input_identifier end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 3 def @message end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
2 3 4 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 2 def @timestamp end |
Instance Method Details
#add_error(error_source, error) ⇒ Object
16 17 18 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 16 def add_error(error_source, error) errors[error_source] << error end |
#error_count ⇒ Object
20 21 22 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 20 def error_count errors.values.flatten.length end |
#errors? ⇒ Boolean
24 25 26 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 24 def errors? errors.values.flatten.any? end |
#set_timestamp ⇒ Object
12 13 14 |
# File 'lib/topographer/importer/strategy/import_status.rb', line 12 def @timestamp ||= DateTime.now end |