Class: VisionMate::Tube

Inherits:
Object
  • Object
show all
Defined in:
lib/vision_mate/tube.rb

Overview

Tube provides barcode and other meta information for each individual test tube inside the rack. Tube’s are usually returned as a collection within a ‘Rack` object once a scan is performed.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(barcode, position) ⇒ Tube

Returns a new instance of Tube.



15
16
17
18
# File 'lib/vision_mate/tube.rb', line 15

def initialize(barcode, position)
  self.barcode = barcode
  self.position = position
end

Instance Attribute Details

#barcodeObject

Returns the value of attribute barcode.



7
8
9
# File 'lib/vision_mate/tube.rb', line 7

def barcode
  @barcode
end

#positionObject

Returns the value of attribute position.



7
8
9
# File 'lib/vision_mate/tube.rb', line 7

def position
  @position
end

Class Method Details

.create(barcode, position) ⇒ Object



9
10
11
12
13
# File 'lib/vision_mate/tube.rb', line 9

def self.create(barcode, position)
  return NoTube.new(barcode, position) if barcode == "No Tube"

  Tube.new(barcode, position)
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/vision_mate/tube.rb', line 20

def empty?
  false
end