Class: Topographer::Importer::Mapper::Result
- Inherits:
-
Object
- Object
- Topographer::Importer::Mapper::Result
- Defined in:
- lib/topographer/importer/mapper/result.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#source_identifier ⇒ Object
readonly
Returns the value of attribute source_identifier.
Instance Method Summary collapse
- #add_data(key, value) ⇒ Object
- #add_error(key, value) ⇒ Object
- #errors? ⇒ Boolean
-
#initialize(source_identifier) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(source_identifier) ⇒ Result
Returns a new instance of Result.
4 5 6 7 8 |
# File 'lib/topographer/importer/mapper/result.rb', line 4 def initialize(source_identifier) @source_identifier = source_identifier @data = {} @errors = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
2 3 4 |
# File 'lib/topographer/importer/mapper/result.rb', line 2 def data @data end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
2 3 4 |
# File 'lib/topographer/importer/mapper/result.rb', line 2 def errors @errors end |
#source_identifier ⇒ Object (readonly)
Returns the value of attribute source_identifier.
2 3 4 |
# File 'lib/topographer/importer/mapper/result.rb', line 2 def source_identifier @source_identifier end |
Instance Method Details
#add_data(key, value) ⇒ Object
10 11 12 |
# File 'lib/topographer/importer/mapper/result.rb', line 10 def add_data (key, value) @data[key] = value end |
#add_error(key, value) ⇒ Object
14 15 16 |
# File 'lib/topographer/importer/mapper/result.rb', line 14 def add_error (key, value) @errors[key] = value end |
#errors? ⇒ Boolean
18 19 20 |
# File 'lib/topographer/importer/mapper/result.rb', line 18 def errors? errors.any? end |