Module: LabelPrinter::Label::MultipleDoubleLabels

Includes:
MultipleLabels
Included in:
BasePlateDouble
Defined in:
lib/label_printer/label_printer/multiple_double_labels.rb

Instance Attribute Summary

Attributes included from MultipleLabels

#count

Instance Method Summary collapse

Methods included from MultipleLabels

#label, #labels, #to_h

Instance Method Details

#create_labelsObject


8
9
10
11
12
13
14
# File 'lib/label_printer/label_printer/multiple_double_labels.rb', line 8

def create_labels
  [].tap do |l|
    assets.each do |asset|
      count.times { l.push(*double_label(asset)) }
    end
  end
end

#double_label(asset) ⇒ Object


16
17
18
# File 'lib/label_printer/label_printer/multiple_double_labels.rb', line 16

def double_label(asset)
  [label(asset), extra_label(asset)]
end

#extra_label(asset) ⇒ Object


20
21
22
# File 'lib/label_printer/label_printer/multiple_double_labels.rb', line 20

def extra_label(asset)
  { extra_label: create_extra_label(asset) }
end