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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from UatActions

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

Class Method Details

.defaultObject


36
37
38
39
40
41
42
43
44
# File 'app/uat_actions/uat_actions/generate_plates.rb', line 36

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

Instance Method Details

#performObject


46
47
48
49
50
51
52
53
# File 'app/uat_actions/uat_actions/generate_plates.rb', line 46

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