Class: LabelPrinter::Label::BatchMultiplex

Inherits:
BaseTube
  • Object
show all
Defined in:
lib/label_printer/label_printer/label/batch_multiplex.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseTube

#assets, #barcode, #bottom_line, #create_label, #date_today, #middle_line, #round_label_bottom_line, #round_label_top_line

Methods included from MultipleLabels

#create_labels, #label, #labels, #to_h

Constructor Details

#initialize(options) ⇒ BatchMultiplex

Returns a new instance of BatchMultiplex


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

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


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

def batch
  @batch
end

#countObject (readonly)

Returns the value of attribute count


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

def count
  @count
end

#printableObject (readonly)

Returns the value of attribute printable


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

def printable
  @printable
end

Instance Method Details

#top_line(tube) ⇒ Object


12
13
14
# File 'lib/label_printer/label_printer/label/batch_multiplex.rb', line 12

def top_line(tube)
  "(p) #{tube.name}"
end

#tubesObject


16
17
18
19
20
21
# File 'lib/label_printer/label_printer/label/batch_multiplex.rb', line 16

def tubes
  if batch.multiplexed?
    ids = printable.select { |_id, check| check == 'on' }.keys
    Labware.find ids
  end
end