Class: SpecificTubeCreation

Inherits:
TubeCreation show all
Defined in:
app/models/specific_tube_creation.rb

Defined Under Namespace

Classes: ChildPurpose

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AssetCreation

#create_ancestor_asset!

Methods included from Asset::Ownership::ChangesOwner

included

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Attribute Details

#tube_attributesObject

If no tube attributes are specified, fall back to an array of empty hashes


29
30
31
# File 'app/models/specific_tube_creation.rb', line 29

def tube_attributes
  @tube_attributes || Array.new(child_purposes.length, {})
end

Instance Method Details

#multiple_purposesObject


24
25
26
# File 'app/models/specific_tube_creation.rb', line 24

def multiple_purposes
  true
end

#set_child_purposes=(uuids) ⇒ Object


20
21
22
# File 'app/models/specific_tube_creation.rb', line 20

def set_child_purposes=(uuids)
  self.child_purposes = uuids.map { |uuid| Uuid.find_by(external_id: uuid).resource }
end