Class: LabelPrinter::Label::SampleManifestMultiplex
- Defined in:
- lib/label_printer/label/sample_manifest_multiplex.rb
Instance Attribute Summary collapse
-
#sample_manifest ⇒ Object
readonly
Returns the value of attribute sample_manifest.
Attributes included from MultipleLabels
Instance Method Summary collapse
-
#barcode(tube) ⇒ String
Returns the appropriate barcode for the given tube based on the barcode type.
- #first_line(_tube = nil) ⇒ Object
-
#initialize(options) ⇒ SampleManifestMultiplex
constructor
A new instance of SampleManifestMultiplex.
- #tubes ⇒ Object
Methods inherited from BaseTube
#assets, #build_label, #date_today, #round_label_bottom_line, #round_label_top_line, #second_line, #third_line
Methods included from MultipleLabels
Constructor Details
#initialize(options) ⇒ SampleManifestMultiplex
Returns a new instance of SampleManifestMultiplex.
7 8 9 10 11 12 |
# File 'lib/label_printer/label/sample_manifest_multiplex.rb', line 7 def initialize() super() @sample_manifest = [:sample_manifest] @only_first_label = [:only_first_label] @barcode_type = [:barcode_type] end |
Instance Attribute Details
#sample_manifest ⇒ Object (readonly)
Returns the value of attribute sample_manifest.
5 6 7 |
# File 'lib/label_printer/label/sample_manifest_multiplex.rb', line 5 def sample_manifest @sample_manifest end |
Instance Method Details
#barcode(tube) ⇒ String
Returns the appropriate barcode for the given tube based on the barcode type.
20 21 22 23 24 25 26 |
# File 'lib/label_printer/label/sample_manifest_multiplex.rb', line 20 def (tube) if @barcode_type == Rails.application.config.[:barcode_type_labels]['2d'] return tube. end tube. end |
#first_line(_tube = nil) ⇒ Object
28 29 30 |
# File 'lib/label_printer/label/sample_manifest_multiplex.rb', line 28 def first_line(_tube = nil) sample_manifest.study.abbreviation end |
#tubes ⇒ Object
32 33 34 |
# File 'lib/label_printer/label/sample_manifest_multiplex.rb', line 32 def tubes [sample_manifest.printables] end |