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.


10
11
12
13
14
15
16
# File 'app/models/robot/generator/base.rb', line 10

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


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

def batch
  @batch
end

#ctrl_barcode_indexObject (readonly)

Returns the value of attribute ctrl_barcode_index


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

def ctrl_barcode_index
  @ctrl_barcode_index
end

#dest_barcode_indexObject (readonly)

Returns the value of attribute dest_barcode_index


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

def dest_barcode_index
  @dest_barcode_index
end

#picking_dataObject (readonly)

Returns the value of attribute picking_data


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

def picking_data
  @picking_data
end

#plate_barcodeObject (readonly)

Returns the value of attribute plate_barcode


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

def plate_barcode
  @plate_barcode
end

#source_barcode_indexObject (readonly)

Returns the value of attribute source_barcode_index


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

def source_barcode_index
  @source_barcode_index
end

Instance Method Details

#total_volumeObject


18
19
20
# File 'app/models/robot/generator/base.rb', line 18

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

#typeObject

The MIME type of the generated file.


23
24
25
# File 'app/models/robot/generator/base.rb', line 23

def type
  'text/plain'
end