Class: LabwareCreators::CustomPooledTubes

Inherits:
PooledTubesBase show all
Includes:
CustomPage, SupportParent::PlateReadyForCustomPoolingOnly
Defined in:
app/models/labware_creators/custom_pooled_tubes.rb

Overview

Allows the user to create custom pooled tubes. The user may create an arbitrary number of tubes, with 1 or more wells in each. An individual well may contribute to more than one tube. Layout is specified by uploading the same CSV which will be used to drive the robot.

Defined Under Namespace

Classes: CsvFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from LabwareCreators::Base

Instance Attribute Details

#fileObject

Returns the value of attribute file.



17
18
19
# File 'app/models/labware_creators/custom_pooled_tubes.rb', line 17

def file
  @file
end

Instance Method Details

#parentObject Originally defined in module SupportParent::PlateReadyForCustomPoolingOnly

#saveObject



25
26
27
# File 'app/models/labware_creators/custom_pooled_tubes.rb', line 25

def save
  super && upload_file && true
end

#wells_occupied?Boolean

Returns:

  • (Boolean)


29
30
31
32
33
34
35
36
37
38
# File 'app/models/labware_creators/custom_pooled_tubes.rb', line 29

def wells_occupied?
  pools.values.flatten.uniq.each do |location|
    well = well_locations[location]
    if well.nil? || well.aliquots.empty?
      errors.add(:csv_file, "includes empty well, #{location}")
    elsif well.pending?
      errors.add(:csv_file, "includes pending well, #{location}")
    end
  end
end