Class: UatActions::GenerateTagGroup
- Inherits:
-
UatActions
- Object
- UatActions
- UatActions::GenerateTagGroup
- Defined in:
- app/uat_actions/uat_actions/generate_tag_group.rb
Overview
Will construct plates with well_count wells filled with samples
Constant Summary
Constants inherited from UatActions
Class Method Summary collapse
-
.default ⇒ UatActions::GenerateTagGroup
Returns a default copy of the UatAction which will be used to fill in the form.
Instance Method Summary collapse
- #create_tag_group(name, adapter_type) ⇒ Object
- #existing_tags ⇒ Object
-
#perform ⇒ Boolean
[perform description].
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
.default ⇒ UatActions::GenerateTagGroup
Returns a default copy of the UatAction which will be used to fill in the form
52 53 54 |
# File 'app/uat_actions/uat_actions/generate_tag_group.rb', line 52 def self.default new(size: 384) end |
Instance Method Details
#create_tag_group(name, adapter_type) ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 |
# File 'app/uat_actions/uat_actions/generate_tag_group.rb', line 72 def create_tag_group(name, adapter_type) tag_group = TagGroup.create!(name: name, adapter_type_id: adapter_type&.id) tag_group..build( OligoEnumerator .new(size.to_i, tag_sequence_offset.to_i) .each_with_index .map { |oligo, map_id| { oligo: oligo, map_id: map_id + 1 } } ) tag_group.save end |
#existing_tags ⇒ Object
84 85 86 |
# File 'app/uat_actions/uat_actions/generate_tag_group.rb', line 84 def @tag_group..count end |
#perform ⇒ Boolean
[perform description]
60 61 62 63 64 65 66 67 68 69 70 |
# File 'app/uat_actions/uat_actions/generate_tag_group.rb', line 60 def perform # Called by the controller once the form is filled in. Add your actual actions here. # All the form fields are accessible as simple attributes. # Return true if everything works report[:name] = name return true if existing_tag_group adapter_type = TagGroup::AdapterType.find_by(name: adapter_type_name) create_tag_group(name, adapter_type) end |