Class: RequestInformationType

Inherits:
ApplicationRecord show all
Defined in:
app/models/request_information_type.rb

Overview

A request information type associates a pipeline with request information, either via Metadata::Metadata or a LabEvent

Constant Summary collapse

FORMATTERS =
{ 'String' => ->(v) { v.to_s }, 'Date' => ->(v) { v.to_date&.strftime('%d %B %Y') } }.freeze

Instance Method Summary collapse

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

extended

Instance Method Details

#data_typeObject



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

def data_type
  super || 'String'
end

#value_for(request, batch) ⇒ Object



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

def value_for(request, batch)
  format((request) || event_value_for(request, batch))
end