Module: Sequencescape::Api::V2::Shared::HasWorklineIdentifier

Extended by:
ActiveSupport::Concern
Included in:
Plate, Tube
Defined in:
app/sequencescape/sequencescape/api/v2/shared/has_workline_identifier.rb

Overview

Include in API endpoints that have barcodes to add a few standard methods

Instance Method Summary collapse

Instance Method Details

#workline_identifierObject



21
22
23
# File 'app/sequencescape/sequencescape/api/v2/shared/has_workline_identifier.rb', line 21

def workline_identifier
  workline_reference&.barcode&.human
end

#workline_referenceObject

Finds a relevant related labware in order to include its barode on the barcode label. Existing use at time of writing is in the top right part of plate labels. In future it could also be included on tube labels if needed. Uses alternative_workline_identifier from the purpose config if present, otherwise uses the stock plate.



14
15
16
17
18
19
# File 'app/sequencescape/sequencescape/api/v2/shared/has_workline_identifier.rb', line 14

def workline_reference
  alternative_workline_identifier_purpose = SearchHelper.alternative_workline_reference_name(self)
  return stock_plate if alternative_workline_identifier_purpose.nil?

  ancestors.where(purpose_name: alternative_workline_identifier_purpose).last
end