Class: LabelPrinter::Label::BatchTube
- Defined in:
- lib/label_printer/label/batch_tube.rb
Instance Attribute Summary collapse
-
#batch ⇒ Object
readonly
Returns the value of attribute batch.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#printable ⇒ Object
readonly
Returns the value of attribute printable.
-
#stock ⇒ Object
readonly
Returns the value of attribute stock.
Instance Method Summary collapse
- #first_line(tube) ⇒ Object
-
#initialize(options) ⇒ BatchTube
constructor
A new instance of BatchTube.
- #tubes ⇒ Object
Methods inherited from BaseTube
#assets, #barcode, #build_label, #date_today, #round_label_bottom_line, #round_label_top_line, #second_line, #third_line
Methods included from MultipleLabels
Constructor Details
#initialize(options) ⇒ BatchTube
Returns a new instance of BatchTube.
7 8 9 10 11 12 13 |
# File 'lib/label_printer/label/batch_tube.rb', line 7 def initialize() super() @count = [:count].to_i @printable = [:printable] @batch = [:batch] @stock = [:stock] end |
Instance Attribute Details
#batch ⇒ Object (readonly)
Returns the value of attribute batch.
5 6 7 |
# File 'lib/label_printer/label/batch_tube.rb', line 5 def batch @batch end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
5 6 7 |
# File 'lib/label_printer/label/batch_tube.rb', line 5 def count @count end |
#printable ⇒ Object (readonly)
Returns the value of attribute printable.
5 6 7 |
# File 'lib/label_printer/label/batch_tube.rb', line 5 def printable @printable end |
#stock ⇒ Object (readonly)
Returns the value of attribute stock.
5 6 7 |
# File 'lib/label_printer/label/batch_tube.rb', line 5 def stock @stock end |
Instance Method Details
#first_line(tube) ⇒ Object
15 16 17 |
# File 'lib/label_printer/label/batch_tube.rb', line 15 def first_line(tube) stock.present? ? tube.name : tube.name_for_label end |
#tubes ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/label_printer/label/batch_tube.rb', line 19 def tubes @tubes ||= if stock.present? # all info on a label including barcode is about target_asset stock asset requests.map { |request| request.target_labware.stock_asset } else # all info on a label including barcode is about target_asset requests.map(&:target_labware) end end |