Class: Robots::PoolingRobot

Inherits:
Robot
  • Object
show all
Defined in:
app/models/robots/pooling_robot.rb

Overview

rubocop:todo Style/Documentation

Direct Known Subclasses

QuadrantRobot

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#destination_bedObject



26
27
28
# File 'app/models/robots/pooling_robot.rb', line 26

def destination_bed
  beds[@destination_bed]
end

Instance Method Details

#bed_classObject



22
23
24
# File 'app/models/robots/pooling_robot.rb', line 22

def bed_class
  Robots::Bed::Pooling
end

#destination_bed_idObject



30
31
32
# File 'app/models/robots/pooling_robot.rb', line 30

def destination_bed_id
  @destination_bed
end

#valid_relationshipsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/models/robots/pooling_robot.rb', line 7

def valid_relationships
  verified = {}
  if destination_bed.empty?
    # We don't even have a destination barcode
    verified[destination_bed_id] = false
    error(destination_bed, 'No destination plate barcode provided')
  elsif destination_bed.valid?
    # The destination bed is valid, so check its parents are correct
    destination_bed.each_parent do |bed_barcode, expected_barcode|
      verified[bed_barcode] = validate_parent(bed_barcode, expected_barcode)
    end
  end
  verified
end