Class: PlatePurpose::Input

Inherits:
PlatePurpose show all
Includes:
Stock
Defined in:
app/models/plate_purpose/input.rb

Overview

Input Plate purposes are the initial stock plates passing into external piplines. They have special behaviour governing their state.

Constant Summary collapse

WELL_STATE_PRIORITY =
%w[pending started passed failed cancelled].freeze

Constants included from Stock

Stock::READY_STATE, Stock::UNREADY_STATE

Instance Method Summary collapse

Methods included from Stock

#state_of

Methods inherited from PlatePurpose

#asset_shape, #attatched?, #cherrypick_completed, #cherrypick_in_rows?, #child_plate_purposes, #create!, #input_plate=, #plate_height, #plate_width, #pool_wells, #size, #source_plate, #source_plates, #source_wells_for, #state_of, stock_plate_purpose, #supports_multiple_submissions?, #transition_to

Methods included from Api::PlatePurposeIO::Extensions

included, #json_root

Methods included from Purpose::Relationship::Associations

included

Methods included from SharedBehaviour::Named

included

Methods inherited from Purpose

#barcode_type, #prefix=, #set_default_barcode_prefix, #source_plate, #target_class

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#calculate_state_of_well(wells_states) ⇒ Object

Unlike other stock purposes


9
10
11
# File 'app/models/plate_purpose/input.rb', line 9

def calculate_state_of_well(wells_states)
  wells_states.min_by { |state| WELL_STATE_PRIORITY.index(state) || WELL_STATE_PRIORITY.length }
end