Class: LabelPrinter::Label::SampleManifestPlateDouble
- Inherits:
-
BasePlateDouble
- Object
- BasePlateDouble
- LabelPrinter::Label::SampleManifestPlateDouble
- Defined in:
- lib/label_printer/label/sample_manifest_plate_double.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
- #build_extra_label(_plate) ⇒ Object
- #build_label(plate) ⇒ Object
-
#initialize(options) ⇒ SampleManifestPlateDouble
constructor
A new instance of SampleManifestPlateDouble.
- #plates ⇒ Object
Methods inherited from BasePlateDouble
#assets, #barcode, #date_today
Methods included from MultipleDoubleLabels
Methods included from MultipleLabels
Constructor Details
#initialize(options) ⇒ SampleManifestPlateDouble
Returns a new instance of SampleManifestPlateDouble.
10 11 12 13 14 |
# File 'lib/label_printer/label/sample_manifest_plate_double.rb', line 10 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.
8 9 10 |
# File 'lib/label_printer/label/sample_manifest_plate_double.rb', line 8 def only_first_label @only_first_label end |
#sample_manifest ⇒ Object (readonly)
Returns the value of attribute sample_manifest.
8 9 10 |
# File 'lib/label_printer/label/sample_manifest_plate_double.rb', line 8 def sample_manifest @sample_manifest end |
Instance Method Details
#build_extra_label(_plate) ⇒ Object
25 26 27 |
# File 'lib/label_printer/label/sample_manifest_plate_double.rb', line 25 def build_extra_label(_plate) { left_text: date_today, right_text: @sample_manifest.purpose.name, label_name: 'extra_label' } end |
#build_label(plate) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/label_printer/label/sample_manifest_plate_double.rb', line 16 def build_label(plate) { left_text: plate., right_text: "#{sample_manifest.study.abbreviation} #{plate.}", barcode: (plate), label_name: 'main_label' } end |
#plates ⇒ Object
29 30 31 32 33 |
# File 'lib/label_printer/label/sample_manifest_plate_double.rb', line 29 def plates return [sample_manifest.printables.first] if only_first_label sample_manifest.printables end |