Class: LabelPrinter::Label::AssetPlate

Inherits:
BasePlate
  • Object
show all
Defined in:
lib/label_printer/label/asset_plate.rb

Instance Attribute Summary collapse

Attributes included from MultipleLabels

#count

Instance Method Summary collapse

Methods inherited from BasePlate

#assets, #barcode, #bottom_left, #build_label, #date_today, #top_left

Methods included from MultipleLabels

#create_labels, #labels

Constructor Details

#initialize(plates) ⇒ AssetPlate

Returns a new instance of AssetPlate.



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

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

Instance Attribute Details

#platesObject (readonly)

Returns the value of attribute plates.



5
6
7
# File 'lib/label_printer/label/asset_plate.rb', line 5

def plates
  @plates
end

Instance Method Details

#bottom_right(plate) ⇒ Object



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

def bottom_right(plate)
  plate.studies.first&.abbreviation
end

#top_far_right(plate) ⇒ Object



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

def top_far_right(plate)
  plate.parent.try(:human_barcode).to_s
end

#top_right(plate) ⇒ Object



12
13
14
# File 'lib/label_printer/label/asset_plate.rb', line 12

def top_right(plate)
  plate.plate_purpose.name.to_s
end