Class: LabelPrinter::Label::SampleManifestPlate
- Defined in:
- lib/label_printer/label/sample_manifest_plate.rb
Instance Attribute Summary collapse
-
#only_first_label ⇒ Object
readonly
Returns the value of attribute only_first_label.
-
#sample_manifest ⇒ Object
readonly
Returns the value of attribute sample_manifest.
Attributes included from MultipleLabels
Instance Method Summary collapse
- #bottom_right(plate) ⇒ Object
-
#initialize(options) ⇒ SampleManifestPlate
constructor
A new instance of SampleManifestPlate.
- #plates ⇒ Object
- #top_right(_plate = nil) ⇒ Object
Methods inherited from BasePlate
#assets, #barcode, #bottom_left, #build_label, #date_today, #top_far_right, #top_left
Methods included from MultipleLabels
Constructor Details
#initialize(options) ⇒ SampleManifestPlate
Returns a new instance of SampleManifestPlate.
7 8 9 10 11 |
# File 'lib/label_printer/label/sample_manifest_plate.rb', line 7 def initialize() super() @sample_manifest = [:sample_manifest] @only_first_label = [:only_first_label] end |
Instance Attribute Details
#only_first_label ⇒ Object (readonly)
Returns the value of attribute only_first_label.
5 6 7 |
# File 'lib/label_printer/label/sample_manifest_plate.rb', line 5 def only_first_label @only_first_label end |
#sample_manifest ⇒ Object (readonly)
Returns the value of attribute sample_manifest.
5 6 7 |
# File 'lib/label_printer/label/sample_manifest_plate.rb', line 5 def sample_manifest @sample_manifest end |
Instance Method Details
#bottom_right(plate) ⇒ Object
17 18 19 |
# File 'lib/label_printer/label/sample_manifest_plate.rb', line 17 def bottom_right(plate) "#{sample_manifest.study.abbreviation} #{plate.}" end |
#plates ⇒ Object
21 22 23 24 25 |
# File 'lib/label_printer/label/sample_manifest_plate.rb', line 21 def plates return [sample_manifest.printables.first] if only_first_label sample_manifest.printables end |
#top_right(_plate = nil) ⇒ Object
13 14 15 |
# File 'lib/label_printer/label/sample_manifest_plate.rb', line 13 def top_right(_plate = nil) @sample_manifest.purpose.name end |