Class: LabelPrinter::Label::BaseTube

Inherits:
Object
  • Object
show all
Includes:
MultipleLabels
Defined in:
lib/label_printer/label_printer/label/base_tube.rb

Instance Attribute Summary

Attributes included from MultipleLabels

#count

Instance Method Summary collapse

Methods included from MultipleLabels

#create_labels, #label, #labels, #to_h

Instance Method Details

#assetsObject


42
43
44
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 42

def assets
  tubes
end

#barcode(tube) ⇒ Object


34
35
36
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 34

def barcode(tube)
  tube.ean13_barcode
end

#bottom_line(_tube) ⇒ Object


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

def bottom_line(_tube)
  date_today
end

#create_label(tube) ⇒ Object


6
7
8
9
10
11
12
13
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 6

def create_label(tube)
  { top_line: top_line(tube),
    middle_line: middle_line(tube),
    bottom_line: bottom_line(tube),
    round_label_top_line: round_label_top_line(tube),
    round_label_bottom_line: round_label_bottom_line(tube),
    barcode: barcode(tube) }
end

#date_todayObject


46
47
48
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 46

def date_today
  Date.today.strftime('%e-%^b-%Y')
end

#middle_line(tube) ⇒ Object


18
19
20
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 18

def middle_line(tube)
  tube.barcode_number
end

#round_label_bottom_line(tube) ⇒ Object


30
31
32
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 30

def round_label_bottom_line(tube)
  tube.barcode_number
end

#round_label_top_line(tube) ⇒ Object


26
27
28
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 26

def round_label_top_line(tube)
  tube.prefix
end

#top_line(tube) ⇒ Object


15
16
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 15

def top_line(tube)
end

#tubesObject


38
39
40
# File 'lib/label_printer/label_printer/label/base_tube.rb', line 38

def tubes
  @tubes || []
end