Class: TransferTemplate

Inherits:
ApplicationRecord show all
Includes:
Uuid::Uuidable
Defined in:
app/models/transfer_template.rb

Overview

A template is effectively a partially constructed Transfer instance, containing only the transfers that should be made and the final Transfer class that should be constructed.

For pulldown there are at least a couple of these templates:

  • several plate-to-plate transfers of various columns (but all rows)

  • one whole plate to tube transfer

Instance Method Summary collapse

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 Method Details

#create!(attributes) ⇒ Object


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

def create!(attributes)
  transfer_class.create!(transfer_attributes(attributes))
end

#preview!(attributes) ⇒ Object


28
29
30
# File 'app/models/transfer_template.rb', line 28

def preview!(attributes)
  transfer_class.preview!(transfer_attributes(attributes))
end

#transfer_classObject


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

def transfer_class
  @transfer_class ||= transfer_class_name.constantize
end