class Glossarist::LocalizedConcept
Attributes
Must be one of the following: preferred
, admitted
, deprecated
. @todo Proper type checking. @note Works with strings, but soon they may be replaced with symbols. @return [String]
Concept
definition. @todo Support multiple definitions. @return [String]
Concept
designations. @todo Alias terms
exists only for legacy reasons and will be removed. @return [Array<Designations::Base>]
Must be one of the following: notValid
, valid
, superseded
, retired
. @todo Proper type checking. @note Works with strings, but soon they may be replaced with symbols. @return [String]
@return [Array<String>]
Needs to be identical with {Concept#id}. @todo Here for legacy reasons. Will be removed eventually.
ISO 639-2 code for terminology. @see www.loc.gov/standards/iso639-2/php/code_list.php code list @return [String]
@return [Array<String>]
@todo Right now accepts hashes for legacy reasons, but they will be
replaced with dedicated classes.
@todo Alias authoritative_source
exists for legacy reasons and may be
removed.
@return [Array<Hash>]
@todo Here for legacy reasons. Will be moved to Concept
. @todo Right now is an array of hashes for legacy reasons, but these hashes
will be replaced with some dedicated class.
@todo Should be read-only, but for now it is not for legacy reasons.
Don't use the setter.
@return [Array<Hash>]
Concept
designations. @todo Alias terms
exists only for legacy reasons and will be removed. @return [Array<Designations::Base>]
Concept
designations. @todo Alias terms
exists only for legacy reasons and will be removed. @return [Array<Designations::Base>]
Public Class Methods
# File lib/glossarist/localized_concept.rb, line 101 def self.from_h(hash) terms = hash["terms"]&.map { |h| Designations::Base.from_h(h) } || [] super(hash.merge({"terms" => terms})) end
# File lib/glossarist/localized_concept.rb, line 73 def initialize(*) @examples = [] @notes = [] @designations = [] @superseded_concepts = [] @sources = [] super end
Public Instance Methods
# File lib/glossarist/localized_concept.rb, line 82 def to_h # rubocop:disable Metrics/MethodLength { "id" => id, "terms" => (terms&.map(&:to_h) || []), "definition" => definition, "language_code" => language_code, "notes" => notes, "examples" => examples, "entry_status" => entry_status, "classification" => classification, "authoritative_source" => (sources if sources&.any?), "date_accepted" => date_accepted, "date_amended" => date_amended, "review_date" => review_date, "review_decision_date" => review_decision_date, "review_decision_event" => review_decision_event, }.compact end
@deprecated For legacy reasons only.
Implicit conversion (i.e. {#to_hash} alias) will be removed soon.