Class: CsvFile::RowForTubeRackWithRackBarcode

Inherits:
RowForTubeRack
  • Object
show all
Defined in:
app/models/labware_creators/common_file_handling/csv_file/row_for_tube_rack_with_rack_barcode.rb

Overview

This is a shared class for handling rows within tube rack csv files. It provides a simple wrapper for handling and validating an individual row A row in this file should contain a tube rack barcode, the tube location (coordinate within the rack) and the tube barcode i.e. Tube Rack Barcode, Tube Position, Tube Barcode

Constant Summary collapse

TUBE_RACK_BARCODE_MISSING =
'cannot be empty, in %s'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tube_rack_barcodeObject (readonly)

Returns the value of attribute tube_rack_barcode.



16
17
18
# File 'app/models/labware_creators/common_file_handling/csv_file/row_for_tube_rack_with_rack_barcode.rb', line 16

def tube_rack_barcode
  @tube_rack_barcode
end

Instance Method Details

#expected_number_of_columnsObject



30
31
32
# File 'app/models/labware_creators/common_file_handling/csv_file/row_for_tube_rack_with_rack_barcode.rb', line 30

def expected_number_of_columns
  3
end

#initialize_context_specific_fieldsObject



22
23
24
25
26
27
28
# File 'app/models/labware_creators/common_file_handling/csv_file/row_for_tube_rack_with_rack_barcode.rb', line 22

def initialize_context_specific_fields
  # NB. cannot use upcase here as unusual characters will cause an exception and this happens before the
  # check_for_invalid_characters validation
  @tube_rack_barcode = (@row_data[0] || '').strip
  @tube_position = (@row_data[1] || '').strip
  @tube_barcode = (@row_data[2] || '').strip
end