Class: Glossarist::ConceptData
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Glossarist::ConceptData
show all
- Includes:
- Utilities::CommonFunctions
- Defined in:
- lib/glossarist/concept_data.rb
Instance Method Summary
collapse
#convert_keys_to_snake_case, #slice_keys, #snake_case, #stringify_keys, #symbolize_keys
Instance Method Details
#authoritative_source ⇒ Object
70
71
72
73
74
|
# File 'lib/glossarist/concept_data.rb', line 70
def authoritative_source
return [] unless sources
sources.select(&:authoritative?)
end
|
#date_accepted ⇒ Object
64
65
66
67
68
|
# File 'lib/glossarist/concept_data.rb', line 64
def date_accepted
return nil unless dates
dates.find(&:accepted?)
end
|
#terms_from_yaml(model, value) ⇒ Object
56
57
58
|
# File 'lib/glossarist/concept_data.rb', line 56
def terms_from_yaml(model, value)
model.terms = value.map { |v| Designation::Base.of_yaml(v) }
end
|
#terms_to_yaml(model, doc) ⇒ Object
60
61
62
|
# File 'lib/glossarist/concept_data.rb', line 60
def terms_to_yaml(model, doc)
doc["terms"] = model.terms&.map(&:to_yaml_hash)
end
|