Class: Labels::PlateLabelLtnAlLib

Inherits:
PlateLabelBase
  • Object
show all
Defined in:
app/models/labels/plate_label_ltn_al_lib.rb

Overview

Plate label class to print off the QC and intermediate plates from the LTN Al Lib plate. Very specific to this particular pipeline and plate purpose. Maybe if we get more like this consider refactoring into something more flexible that can use configuration from the plate purpose to determine what to print.

Instance Method Summary collapse

Instance Method Details

#additional_label_definitionsObject

rubocop:disable Metrics/AbcSize Define the 3 labels for the immediate child plates (NB. reverse order so printed in correct sequence)



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/labels/plate_label_ltn_al_lib.rb', line 14

def additional_label_definitions
  [
    {
      top_left: date_today,
      bottom_left: labware.barcode.human,
      top_right: labware.stock_plate&.barcode&.human,
      bottom_right: [labware.role, 'LTN Lig'].compact.join(' '),
      barcode: [labware.barcode.human, 'LIG'].compact.join('-')
    },
    {
      top_left: date_today,
      bottom_left: labware.barcode.human,
      top_right: labware.stock_plate&.barcode&.human,
      bottom_right: [labware.role, 'LTN A-tail'].compact.join(' '),
      barcode: [labware.barcode.human, 'ATL'].compact.join('-')
    },
    {
      top_left: date_today,
      bottom_left: labware.barcode.human,
      top_right: labware.stock_plate&.barcode&.human,
      bottom_right: [labware.role, 'LTN Frag'].compact.join(' '),
      barcode: [labware.barcode.human, 'FRG'].compact.join('-')
    }
  ]
end

#attributesObject



8
9
10
# File 'app/models/labels/plate_label_ltn_al_lib.rb', line 8

def attributes
  super.merge(barcode: labware.barcode.human)
end

#qc_label_definitionsObject

NB. reverse order so printed in correct sequence



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'app/models/labels/plate_label_ltn_al_lib.rb', line 41

def qc_label_definitions
  [
    {
      top_left: date_today,
      bottom_left: "#{labware.barcode.human} QC3",
      top_right: labware.stock_plate&.barcode&.human,
      barcode: [labware.barcode.human, 'QC3'].compact.join('-')
    },
    {
      top_left: date_today,
      bottom_left: "#{labware.barcode.human} QC2",
      top_right: labware.stock_plate&.barcode&.human,
      barcode: [labware.barcode.human, 'QC2'].compact.join('-')
    },
    {
      top_left: date_today,
      bottom_left: "#{labware.barcode.human} QC1",
      top_right: labware.stock_plate&.barcode&.human,
      barcode: [labware.barcode.human, 'QC1'].compact.join('-')
    }
  ]
end