Class: LabelPrinter::Label::BasePlate

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

Overview

rubocop:todo Style/Documentation

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


44
45
46
# File 'lib/label_printer/label_printer/label/base_plate.rb', line 44

def assets
  plates
end

#barcode(plate) ⇒ Object


32
33
34
# File 'lib/label_printer/label_printer/label/base_plate.rb', line 32

def barcode(plate)
  plate.machine_barcode
end

#bottom_left(plate) ⇒ Object


19
20
21
# File 'lib/label_printer/label_printer/label/base_plate.rb', line 19

def bottom_left(plate)
  plate.human_barcode
end

#bottom_right(plate) ⇒ Object


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

def bottom_right(plate)
end

#create_label(plate) ⇒ Object


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

def create_label(plate)
  { top_left: top_left,
    bottom_left: bottom_left(plate),
    top_right: top_right(plate),
    bottom_right: bottom_right(plate),
    top_far_right: top_far_right(plate),
    barcode: barcode(plate) }
end

#date_todayObject


36
37
38
# File 'lib/label_printer/label_printer/label/base_plate.rb', line 36

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

#platesObject


40
41
42
# File 'lib/label_printer/label_printer/label/base_plate.rb', line 40

def plates
  @plates || []
end

#top_far_right(plate) ⇒ Object


29
30
# File 'lib/label_printer/label_printer/label/base_plate.rb', line 29

def top_far_right(plate)
end

#top_leftObject


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

def top_left
  date_today
end

#top_right(plate) ⇒ Object


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

def top_right(plate)
end