Class: UatActions::GeneratePlates

Inherits:
UatActions show all
Defined in:
app/uat_actions/uat_actions/generate_plates.rb

Overview

Will construct plates with well_count wells filled with samples

Direct Known Subclasses

GenerateTaggedPlates

Constant Summary

Constants inherited from UatActions

CATEGORY_LIST

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from UatActions

all, category, find, form_field, form_fields, #form_fields, grouped_and_sorted_uat_actions, id, inherited, permitted, #report, #save, to_partial_path, uat_actions

Class Method Details

.defaultObject



51
52
53
54
55
56
57
58
59
60
# File 'app/uat_actions/uat_actions/generate_plates.rb', line 51

def self.default
  new(
    plate_count: 1,
    well_count: 96,
    number_of_samples_in_each_well: 1,
    study_name: UatActions::StaticRecords.study.name,
    plate_purpose_name: PlatePurpose.stock_plate_purpose.name,
    well_layout: 'Column'
  )
end

Instance Method Details

#performObject



62
63
64
65
66
67
68
69
70
71
# File 'app/uat_actions/uat_actions/generate_plates.rb', line 62

def perform
  plate_count.to_i.times do |i|
    plate_purpose.create!.tap do |plate|
      construct_wells(plate)
      report["plate_#{i}"] = plate.human_barcode
      yield plate if block_given?
    end
  end
  true
end