Class: TubeRack::Purpose
- Inherits:
-
Purpose
- Object
- ActiveRecord::Base
- ApplicationRecord
- Purpose
- TubeRack::Purpose
- Defined in:
- app/models/tube_rack/purpose.rb
Overview
The purpose of a tube rack is to hold tubes. Created to hold the size of the tube rack for use when generating manifests.
Class Method Summary collapse
Instance Method Summary collapse
-
#create!(*args) ⇒ Object
Creates the tube rack with the given attributes, setting the purpose and size.
Methods inherited from Purpose
#barcode_type, #prefix=, #set_default_barcode_prefix, #source_plate, #source_plates, #source_purpose_name=, #target_class
Methods included from Uuid::Uuidable
included, #unsaved_uuid!, #uuid
Methods included from SharedBehaviour::Named
Methods included from Purpose::Relationship::Associations
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Class Method Details
.standard_tube_rack ⇒ Object
[View source]
13 14 15 |
# File 'app/models/tube_rack/purpose.rb', line 13 def self.standard_tube_rack TubeRack::Purpose.find_by(name: 'TR Stock 96') end |
Instance Method Details
#create!(*args) ⇒ Object
Creates the tube rack with the given attributes, setting the purpose and size.
18 19 20 21 22 23 |
# File 'app/models/tube_rack/purpose.rb', line 18 def create!(*args, &) = args. [:purpose] = self [:size] = size target_class.create!(*args, , &).tap { |tr| tube_racks << tr } end |