Module: Robots

Defined in:
app/models/robots.rb,
app/models/robots/robot.rb,
app/models/robots/report.rb,
app/models/robots/bed/invalid.rb,
app/models/robots/pooling_robot.rb,
app/models/robots/quadrant_robot.rb,
app/models/robots/splitting_robot.rb,
app/models/robots/tube_rack_wrapper.rb,
app/models/robots/plate_to_tube_racks_robot.rb,
app/models/robots/pooling_and_splitting_robot.rb

Overview

Robots carry out bed verification Each robot in Settings.robots is identified by a key and defines a particular robot program. Robot programs identify the type and state of the plates on each bed as well as relationships between them.

Defined Under Namespace

Modules: Bed Classes: PlateToTubeRacksRobot, PoolingAndSplittingRobot, PoolingRobot, QuadrantRobot, Report, Robot, SplittingRobot, TubeRackWrapper

Class Method Summary collapse

Class Method Details

.each_robotObject



17
18
19
20
# File 'app/models/robots.rb', line 17

def self.each_robot
  # return robots from settings sorted by key
  Settings.robots.sort_by { |key, _| key }.each { |key, config| yield key, config[:name] }
end

.find(options) ⇒ Object

Raises:

  • (ActionController::RoutingError)


9
10
11
12
13
14
15
# File 'app/models/robots.rb', line 9

def self.find(options)
  robot_settings = Settings.robots[options[:id]]
  raise ActionController::RoutingError, "Robot #{options[:name]} Not Found" if robot_settings.nil?

  robot_class = robot_settings.fetch(:class, 'Robots::Robot').constantize
  robot_class.new(robot_settings.to_hash.merge(options))
end