Class: LabelPrinter::Label::BatchPlateDouble

Inherits:
BasePlateDouble show all
Includes:
BatchPlates
Defined in:
lib/label_printer/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, #extra_label

Methods included from MultipleLabels

#create_labels, #label, #labels, #to_h

Constructor Details

#initialize(options) ⇒ BatchPlateDouble


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

def initialize(options)
  @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_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_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_printer/label/batch_plate_double.rb', line 10

def printable
  @printable
end

Instance Method Details

#create_extra_label(plate) ⇒ Object


24
25
26
27
# File 'lib/label_printer/label_printer/label/batch_plate_double.rb', line 24

def create_extra_label(plate)
  { left_text: date_today,
    right_text: "#{@batch.output_plate_role} #{@batch.output_plate_purpose.name} #{plate.barcode_number} #{@batch.studies.first.abbreviation}" }
end

#create_label(plate) ⇒ Object


18
19
20
21
22
# File 'lib/label_printer/label_printer/label/batch_plate_double.rb', line 18

def create_label(plate)
  { left_text: plate.human_barcode.to_s,
    right_text: plate.barcode_number.to_s,
    barcode: barcode(plate) }
end