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 18 19 20 21 |
# File 'lib/label_printer/label/batch_tube.rb', line 15 def first_line(tube) if stock.present? tube.name else tube.respond_to?(:name_for_label) ? tube.name_for_label : tube.name end end |
#tubes ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/label_printer/label/batch_tube.rb', line 23 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 |