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)


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

def applies_to?(_name)
  true
end

#incorrect_format_valueObject



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

def incorrect_format_value
  NOT_PROVIDED
end

#value_for(value) ⇒ Object



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

def value_for(value)
  value
end