Class: SequencescapeExcel::SpecialisedField::RetentionInstruction

Inherits:
Object
  • Object
show all
Includes:
RetentionInstructionHelper, Base, ValueRequired
Defined in:
app/sequencescape_excel/sequencescape_excel/specialised_field/retention_instruction.rb

Overview

Sets Retention Instruction on the labware custom metadata

Instance Attribute Summary

Attributes included from Base

#sample_manifest_asset, #value

Instance Method Summary collapse

Methods included from RetentionInstructionHelper

#find_retention_instruction_from_key, #find_retention_instruction_key_for_value, #find_retention_instruction_to_display, #retention_instruction_option_for_select

Methods included from Base

#link

Instance Method Details

#asset_labwareObject



20
21
22
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/retention_instruction.rb', line 20

def asset_labware
  @asset_labware ||= asset.labware
end

#labware_metadataObject



28
29
30
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/retention_instruction.rb', line 28

def 
  @labware_metadata ||= labware_metadatum_collection..symbolize_keys
end

#labware_metadatum_collectionObject



24
25
26
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/retention_instruction.rb', line 24

def labware_metadatum_collection
  @labware_metadatum_collection ||= asset_labware.custom_metadatum_collection
end

#update(_attributes = {}) ⇒ Object



12
13
14
15
16
17
18
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/retention_instruction.rb', line 12

def update(_attributes = {})
  return unless valid?

  # do nothing unless we can access the labware (assuming asset will be a well or tube receptacle)
  return if asset_labware.blank?
  update_retention_instructions
end