Class: Identifier::Global::Lsid
- Inherits:
-
Identifier::Global
- Object
- Identifier
- Identifier::Global
- Identifier::Global::Lsid
- Defined in:
- app/models/identifier/global/lsid.rb
Overview
urn:lsid:Orthoptera.speciesfile.org:TaxonName:1
• "URN"
• "LSID"
• authority identification
• namespace identification
• object identification
• optionally: revision identification. If revision field is omitted then the trailing colon is also omitted.
Constant Summary
Constants included from SoftValidation
SoftValidation::ANCESTORS_WITH_SOFT_VALIDATIONS
Instance Attribute Summary
Attributes inherited from Identifier::Global
Instance Method Summary collapse
Methods inherited from Identifier::Global
#build_cached, #dwc_occurrences, #is_global?, #sv_resolves?
Methods included from SoftValidation
#clear_soft_validations, #fix_for, #fix_soft_validations, #soft_fixed?, #soft_valid?, #soft_validate, #soft_validated?, #soft_validations, #soft_validators
Instance Method Details
#using_lsid_class ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/identifier/global/lsid.rb', line 13 def using_lsid_class return if identifier.nil? if identifier.match?(/\s/) errors.add(:identifier, "'#{identifier}' is not a valid LSID, it contains whitespace.") return end parts = identifier.split(':') unless parts.length.between?(5, 6) && parts[0].casecmp('urn').zero? && parts[1].casecmp('lsid').zero? && parts[2].present? && # authority parts[3].present? && # namespace parts[4].present? # object errors.add(:identifier, "'#{identifier}' is not a valid LSID.") end end |