Class: Accessionable::Base::Tag::FieldSerializer

Inherits:
Object
  • Object
show all
Defined in:
app/models/accessionable/base.rb

Overview

Value serialization for accessioning XML generation It will return the same value without any changes and it applies to all tags

Direct Known Subclasses

FieldCollectionDate, FieldCountryOfOrigin

Constant Summary collapse

NOT_COLLECTED =
'not collected'
NOT_PROVIDED =
'not provided'
RESTRICTED_ACCESS =
'restricted access'
NOT_APPLICABLE_CONTROL_SAMPLE =
'not applicable: control sample'
NOT_APPLICABLE_SAMPLE_GROUP =
'not applicable: sample group'
MISSING_SYNTHETIC_CONSTRUCT =
'missing: synthetic construct'
MISSING_LAB_STOCK =
'missing: lab stock'
MISING_THIRD_PARTY_DATA =
'missing: third party data'
MISSING_DATA_AGGREEMENT_PRE2023 =
'missing: data agreement established pre-2023'
MISSING_ENDANGERED_SPECIES =
'missing: endangered species'
MISSING_HUMAN_IDENTIFIABLE =
'missing: human-identifiable'
MISSING_CONTROL_SAMPLE =
'missing: control sample'
MISSING_SAMPLE_GROUP =
'missing: sample group'
OTHER_DEFAULT_SETTINGS =
[
  NOT_COLLECTED,
  NOT_PROVIDED,
  RESTRICTED_ACCESS,
  NOT_APPLICABLE_CONTROL_SAMPLE,
  NOT_APPLICABLE_SAMPLE_GROUP,
  MISSING_SYNTHETIC_CONSTRUCT,
  MISSING_LAB_STOCK,
  MISING_THIRD_PARTY_DATA,
  MISSING_DATA_AGGREEMENT_PRE2023,
  MISSING_ENDANGERED_SPECIES,
  MISSING_HUMAN_IDENTIFIABLE,
  MISSING_CONTROL_SAMPLE,
  MISSING_SAMPLE_GROUP
].freeze

Instance Method Summary collapse

Instance Method Details

#applies_to?(_name) ⇒ Boolean

Returns:

  • (Boolean)


112
113
114
# File 'app/models/accessionable/base.rb', line 112

def applies_to?(_name)
  true
end

#incorrect_format_valueObject



116
117
118
# File 'app/models/accessionable/base.rb', line 116

def incorrect_format_value
  NOT_PROVIDED
end

#value_for(value) ⇒ Object



108
109
110
# File 'app/models/accessionable/base.rb', line 108

def value_for(value)
  value
end