Class: LabelPrinter::Label::AssetPlateDouble

Inherits:
BasePlateDouble show all
Defined in:
lib/label_printer/label_printer/label/asset_plate_double.rb

Instance Attribute Summary collapse

Attributes included from MultipleLabels

#count

Instance Method Summary collapse

Methods inherited from BasePlateDouble

#assets, #barcode, #date_today

Methods included from MultipleDoubleLabels

#create_labels, #double_label, #extra_label

Methods included from MultipleLabels

#create_labels, #label, #labels, #to_h

Constructor Details

#initialize(plates) ⇒ AssetPlateDouble

Returns a new instance of AssetPlateDouble


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

def initialize(plates)
  @plates = plates
end

Instance Attribute Details

#platesObject (readonly)

Returns the value of attribute plates


8
9
10
# File 'lib/label_printer/label_printer/label/asset_plate_double.rb', line 8

def plates
  @plates
end

Instance Method Details

#create_extra_label(plate) ⇒ Object


20
21
22
23
# File 'lib/label_printer/label_printer/label/asset_plate_double.rb', line 20

def create_extra_label(plate)
  { left_text: date_today,
    right_text: plate.purpose.name }
end

#create_label(plate) ⇒ Object


14
15
16
17
18
# File 'lib/label_printer/label_printer/label/asset_plate_double.rb', line 14

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