Class: LabelPrinter::Label::SampleManifestPlate

Inherits:
BasePlate
  • Object
show all
Defined in:
lib/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, #build_label, #date_today, #top_far_right, #top_left

Methods included from MultipleLabels

#create_labels, #labels

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(options)
  super()
  @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.



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

def only_first_label
  @only_first_label
end

#sample_manifestObject (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.barcode_number}"
end

#platesObject



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