Class: Robot::Generator::Base

Inherits:
Object
  • Object
show all
Defined in:
app/models/robot/generator/base.rb

Overview

Base class for handling generation of robot picking files for a batch plate

Direct Known Subclasses

Hamilton, Tecan, TecanV2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(batch: nil, plate_barcode: nil, picking_data: nil, layout: nil, total_volume: nil) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
12
13
# File 'app/models/robot/generator/base.rb', line 7

def initialize(batch: nil, plate_barcode: nil, picking_data: nil, layout: nil, total_volume: nil)
  @batch = batch
  @plate_barcode = plate_barcode
  @picking_data = picking_data
  @dest_barcode_index, @source_barcode_index, @ctrl_barcode_index = layout
  @total_volume = total_volume
end

Instance Attribute Details

#batchObject (readonly)

Returns the value of attribute batch.



5
6
7
# File 'app/models/robot/generator/base.rb', line 5

def batch
  @batch
end

#ctrl_barcode_indexObject (readonly)

Returns the value of attribute ctrl_barcode_index.



5
6
7
# File 'app/models/robot/generator/base.rb', line 5

def ctrl_barcode_index
  @ctrl_barcode_index
end

#dest_barcode_indexObject (readonly)

Returns the value of attribute dest_barcode_index.



5
6
7
# File 'app/models/robot/generator/base.rb', line 5

def dest_barcode_index
  @dest_barcode_index
end

#picking_dataObject (readonly)

Returns the value of attribute picking_data.



5
6
7
# File 'app/models/robot/generator/base.rb', line 5

def picking_data
  @picking_data
end

#plate_barcodeObject (readonly)

Returns the value of attribute plate_barcode.



5
6
7
# File 'app/models/robot/generator/base.rb', line 5

def plate_barcode
  @plate_barcode
end

#source_barcode_indexObject (readonly)

Returns the value of attribute source_barcode_index.



5
6
7
# File 'app/models/robot/generator/base.rb', line 5

def source_barcode_index
  @source_barcode_index
end

Instance Method Details

#total_volumeObject



15
16
17
# File 'app/models/robot/generator/base.rb', line 15

def total_volume
  @total_volume ||= @batch&.total_volume_to_cherrypick.to_i
end

#typeObject

The MIME type of the generated file.



20
21
22
# File 'app/models/robot/generator/base.rb', line 20

def type
  'text/plain'
end