Class: BAMFCSV::Table::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/bamfcsv/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header_map, fields) ⇒ Row

Returns a new instance of Row.



41
42
43
44
# File 'lib/bamfcsv/table.rb', line 41

def initialize(header_map, fields)
  @header_map = header_map
  @fields = fields
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



39
40
41
# File 'lib/bamfcsv/table.rb', line 39

def fields
  @fields
end

Instance Method Details

#[](key) ⇒ Object



50
51
52
# File 'lib/bamfcsv/table.rb', line 50

def [](key)
  @fields[@header_map[key]]
end

#headersObject



46
47
48
# File 'lib/bamfcsv/table.rb', line 46

def headers
  @header_map.keys
end