Class: LabelPrinter::Label::AssetPlateDouble

Inherits:
BasePlateDouble show all
Defined in:
lib/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

Methods included from MultipleLabels

#create_labels, #labels

Constructor Details

#initialize(plates) ⇒ AssetPlateDouble

Returns a new instance of AssetPlateDouble.



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

def initialize(plates)
  super()
  @plates = plates
end

Instance Attribute Details

#platesObject (readonly)

Returns the value of attribute plates.



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

def plates
  @plates
end

Instance Method Details

#build_extra_label(plate) ⇒ Object



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

def build_extra_label(plate)
  { left_text: date_today, right_text: plate.purpose.name, label_name: 'extra_label' }
end

#build_label(plate) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/label_printer/label/asset_plate_double.rb', line 15

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