Class: LabelPrinter::Label::BatchPlate

Inherits:
BasePlate
  • Object
show all
Includes:
BatchPlates
Defined in:
lib/label_printer/label/batch_plate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BatchPlates

#plates

Methods inherited from BasePlate

#assets, #barcode, #bottom_left, #build_label, #date_today, #plates, #top_far_right, #top_left

Methods included from MultipleLabels

#create_labels, #labels

Constructor Details

#initialize(options) ⇒ BatchPlate

Returns a new instance of BatchPlate.



11
12
13
14
15
16
# File 'lib/label_printer/label/batch_plate.rb', line 11

def initialize(options)
  super()
  @count = options[:count].to_i
  @printable = options[:printable]
  @batch = options[:batch]
end

Instance Attribute Details

#batchObject (readonly)

Returns the value of attribute batch.



9
10
11
# File 'lib/label_printer/label/batch_plate.rb', line 9

def batch
  @batch
end

#countObject (readonly)

Returns the value of attribute count.



9
10
11
# File 'lib/label_printer/label/batch_plate.rb', line 9

def count
  @count
end

#printableObject (readonly)

Returns the value of attribute printable.



9
10
11
# File 'lib/label_printer/label/batch_plate.rb', line 9

def printable
  @printable
end

Instance Method Details

#bottom_right(plate) ⇒ Object



22
23
24
# File 'lib/label_printer/label/batch_plate.rb', line 22

def bottom_right(plate)
  "#{batch.output_plate_role} #{batch.output_plate_purpose.name} #{plate.barcode_number}"
end

#top_right(_plate = nil) ⇒ Object



18
19
20
# File 'lib/label_printer/label/batch_plate.rb', line 18

def top_right(_plate = nil)
  batch.studies.first.abbreviation
end