Class: Termium::Source
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Termium::Source
- Defined in:
- lib/termium/source.rb
Overview
For <source>
Constant Summary collapse
- ISO_BIB_REGEX =
/\AISO-([\d-]+)\s+\*\s+(\d{4})\s+.*/.freeze
- ISOIEC_BIB_REGEX =
/\AISO-IEC-([\d-]+)\s+\*\s+(\d{4})\s+.*/.freeze
Instance Method Summary collapse
Instance Method Details
#content ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/termium/source.rb', line 17 def content if (matches = details.match(ISOIEC_BIB_REGEX)) "ISO/IEC #{matches[1]}:#{matches[2]}" elsif (matches = details.match(ISO_BIB_REGEX)) "ISO #{matches[1]}:#{matches[2]}" else details end end |
#to_concept_source ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/termium/source.rb', line 27 def to_concept_source Glossarist::ConceptSource.new({ "type" => "lineage", "ref" => content, "status" => "identical", }) end |