Class: LabelPrinter::Label::PlateCreator

Inherits:
BasePlate
  • Object
show all
Defined in:
lib/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, #build_label, #date_today, #top_left

Methods included from MultipleLabels

#create_labels, #labels

Constructor Details

#initialize(options) ⇒ PlateCreator

Returns a new instance of PlateCreator.



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

def initialize(options)
  super()
  @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.



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

def plate_purpose
  @plate_purpose
end

#platesObject (readonly)

Returns the value of attribute plates.



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

def plates
  @plates
end

#user_loginObject (readonly)

Returns the value of attribute user_login.



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

def 
  @user_login
end

Instance Method Details

#bottom_right(plate) ⇒ Object



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

def bottom_right(plate)
  "#{} #{plate.studies.first&.abbreviation}"
end

#top_far_right(plate) ⇒ Object



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

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

#top_right(_plate) ⇒ Object



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

def top_right(_plate)
  plate_purpose.name.to_s
end