Class: LabelPrinter::Label::PlateCreator

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

Instance Attribute Summary collapse

Attributes included from MultipleLabels

#count

Instance Method Summary collapse

Methods inherited from BasePlate

#assets, #barcode, #bottom_left, #create_label, #date_today, #top_left

Methods included from MultipleLabels

#create_labels, #label, #labels, #to_h

Constructor Details

#initialize(options) ⇒ PlateCreator

Returns a new instance of PlateCreator


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

def initialize(options)
  @plates = options[:plates]
  @plate_purpose = options[:plate_purpose]
  @user_login = options[:user_login]
end

Instance Attribute Details

#plate_purposeObject (readonly)

Returns the value of attribute plate_purpose


4
5
6
# File 'lib/label_printer/label_printer/label/plate_creator.rb', line 4

def plate_purpose
  @plate_purpose
end

#platesObject (readonly)

Returns the value of attribute plates


4
5
6
# File 'lib/label_printer/label_printer/label/plate_creator.rb', line 4

def plates
  @plates
end

#user_loginObject (readonly)

Returns the value of attribute user_login


4
5
6
# File 'lib/label_printer/label_printer/label/plate_creator.rb', line 4

def 
  @user_login
end

Instance Method Details

#bottom_right(plate) ⇒ Object


16
17
18
# File 'lib/label_printer/label_printer/label/plate_creator.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_printer/label/plate_creator.rb', line 20

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

#top_right(_plate) ⇒ Object


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

def top_right(_plate)
  plate_purpose.name.to_s
end