Class: LabelPrinter::Label::BatchPlate

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

Methods included from MultipleLabels

#create_labels, #label, #labels, #to_h

Constructor Details

#initialize(options) ⇒ BatchPlate

Returns a new instance of BatchPlate


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

def initialize(options)
  @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_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_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_printer/label/batch_plate.rb', line 9

def printable
  @printable
end

Instance Method Details

#bottom_right(plate) ⇒ Object


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

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

#top_right(_plate = nil) ⇒ Object


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

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