Class: Topographer::Importer::Mapper::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/topographer/importer/mapper/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



2
3
4
# File 'lib/topographer/importer/mapper/result.rb', line 2

def data
  @data
end

#errorsObject (readonly)

Returns the value of attribute errors.



2
3
4
# File 'lib/topographer/importer/mapper/result.rb', line 2

def errors
  @errors
end

#source_identifierObject (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

Returns:

  • (Boolean)


18
19
20
# File 'lib/topographer/importer/mapper/result.rb', line 18

def errors?
  errors.any?
end