Class: LabelPrinter::Label::PlateCreator
- Defined in:
- lib/label_printer/label/plate_creator.rb
Instance Attribute Summary collapse
-
#plate_purpose ⇒ Object
readonly
Returns the value of attribute plate_purpose.
-
#plates ⇒ Object
readonly
Returns the value of attribute plates.
-
#user_login ⇒ Object
readonly
Returns the value of attribute user_login.
Attributes included from MultipleLabels
Instance Method Summary collapse
- #bottom_right(plate) ⇒ Object
-
#initialize(options) ⇒ PlateCreator
constructor
A new instance of PlateCreator.
- #top_far_right(plate) ⇒ Object
- #top_right(_plate) ⇒ Object
Methods inherited from BasePlate
#assets, #barcode, #bottom_left, #build_label, #date_today, #top_left
Methods included from MultipleLabels
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() super() @plates = [:plates] @plate_purpose = [:plate_purpose] @user_login = [:user_login] end |
Instance Attribute Details
#plate_purpose ⇒ Object (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 |
#plates ⇒ Object (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_login ⇒ Object (readonly)
Returns the value of attribute user_login.
5 6 7 |
# File 'lib/label_printer/label/plate_creator.rb', line 5 def user_login @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) "#{user_login} #{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 |