Module: LabelPrinter::Label::MultipleLabels

Included in:
BasePlate, BaseTube, MultipleDoubleLabels
Defined in:
lib/label_printer/label/multiple_labels.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject



22
23
24
# File 'lib/label_printer/label/multiple_labels.rb', line 22

def count
  (@count || 1).to_i
end

Instance Method Details

#create_labelsObject



13
14
15
16
17
18
19
20
# File 'lib/label_printer/label/multiple_labels.rb', line 13

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

#labelsObject



7
8
9
10
11
# File 'lib/label_printer/label/multiple_labels.rb', line 7

def labels
  return [] unless assets

  create_labels
end