Class: LabelPrinter::Label::SampleManifestPlate

Inherits:
BasePlate
  • Object
show all
Defined in:
lib/label_printer/label_printer/label/sample_manifest_plate.rb

Instance Attribute Summary collapse

Attributes included from MultipleLabels

#count

Instance Method Summary collapse

Methods inherited from BasePlate

#assets, #barcode, #bottom_left, #create_label, #date_today, #top_far_right, #top_left

Methods included from MultipleLabels

#create_labels, #label, #labels, #to_h

Constructor Details

#initialize(options) ⇒ SampleManifestPlate

Returns a new instance of SampleManifestPlate


6
7
8
9
# File 'lib/label_printer/label_printer/label/sample_manifest_plate.rb', line 6

def initialize(options)
  @sample_manifest = options[:sample_manifest]
  @only_first_label = options[:only_first_label]
end

Instance Attribute Details

#only_first_labelObject (readonly)

Returns the value of attribute only_first_label


4
5
6
# File 'lib/label_printer/label_printer/label/sample_manifest_plate.rb', line 4

def only_first_label
  @only_first_label
end

#sample_manifestObject (readonly)

Returns the value of attribute sample_manifest


4
5
6
# File 'lib/label_printer/label_printer/label/sample_manifest_plate.rb', line 4

def sample_manifest
  @sample_manifest
end

Instance Method Details

#bottom_right(plate) ⇒ Object


15
16
17
# File 'lib/label_printer/label_printer/label/sample_manifest_plate.rb', line 15

def bottom_right(plate)
  "#{sample_manifest.study.abbreviation} #{plate.barcode_number}"
end

#platesObject


19
20
21
22
23
# File 'lib/label_printer/label_printer/label/sample_manifest_plate.rb', line 19

def plates
  return [sample_manifest.printables.first] if only_first_label

  sample_manifest.printables
end

#top_right(_plate = nil) ⇒ Object


11
12
13
# File 'lib/label_printer/label_printer/label/sample_manifest_plate.rb', line 11

def top_right(_plate = nil)
  @sample_manifest.purpose.name
end