Class: CsvPiper::Errors::Row

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/csv_piper/errors/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row_index) ⇒ Row

Returns a new instance of Row.



9
10
11
12
# File 'lib/csv_piper/errors/row.rb', line 9

def initialize(row_index)
  @row_index = row_index
  @errors = Hash.new { [].freeze }
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



7
8
9
# File 'lib/csv_piper/errors/row.rb', line 7

def errors
  @errors
end

#row_indexObject (readonly)

Returns the value of attribute row_index.



7
8
9
# File 'lib/csv_piper/errors/row.rb', line 7

def row_index
  @row_index
end

Instance Method Details

#add(key, error) ⇒ Object



14
15
16
# File 'lib/csv_piper/errors/row.rb', line 14

def add(key, error)
  @errors[key] += [error]
end