Class: LabelPrinter::Label::BatchPlateDouble

Inherits:
BasePlateDouble show all
Includes:
BatchPlates
Defined in:
lib/label_printer/label/batch_plate_double.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BatchPlates

#plates

Methods inherited from BasePlateDouble

#assets, #barcode, #date_today, #plates

Methods included from MultipleDoubleLabels

#create_labels, #double_label

Methods included from MultipleLabels

#create_labels, #labels

Constructor Details

#initialize(options) ⇒ BatchPlateDouble

Returns a new instance of BatchPlateDouble.



12
13
14
15
16
17
# File 'lib/label_printer/label/batch_plate_double.rb', line 12

def initialize(options)
  super()
  @count = options[:count].to_i
  @printable = options[:printable]
  @batch = options[:batch]
end

Instance Attribute Details

#batchObject (readonly)

Returns the value of attribute batch.



10
11
12
# File 'lib/label_printer/label/batch_plate_double.rb', line 10

def batch
  @batch
end

#countObject (readonly)

Returns the value of attribute count.



10
11
12
# File 'lib/label_printer/label/batch_plate_double.rb', line 10

def count
  @count
end

#printableObject (readonly)

Returns the value of attribute printable.



10
11
12
# File 'lib/label_printer/label/batch_plate_double.rb', line 10

def printable
  @printable
end

Instance Method Details

#build_extra_label(plate) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/label_printer/label/batch_plate_double.rb', line 28

def build_extra_label(plate)
  {
    left_text: date_today,
    right_text:
      # rubocop:todo Layout/LineLength
      "#{@batch.output_plate_role} #{@batch.output_plate_purpose.name} #{plate.barcode_number} #{@batch.studies.first.abbreviation}",
    # rubocop:enable Layout/LineLength
    label_name: 'extra_label'
  }
end

#build_label(plate) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/label_printer/label/batch_plate_double.rb', line 19

def build_label(plate)
  {
    left_text: plate.human_barcode.to_s,
    right_text: plate.barcode_number.to_s,
    barcode: barcode(plate),
    label_name: 'main_label'
  }
end