Class: Tc211::Termbase::Glossarist::Concept

Inherits:
Glossarist::LocalizedConcept
  • Object
show all
Defined in:
lib/tc211/termbase/glossarist/concept.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateAcceptedObject

Returns the value of attribute dateAccepted.



5
6
7
# File 'lib/tc211/termbase/glossarist/concept.rb', line 5

def dateAccepted
  @dateAccepted
end

#statusObject

Returns the value of attribute status.



5
6
7
# File 'lib/tc211/termbase/glossarist/concept.rb', line 5

def status
  @status
end

Instance Method Details

#register_infoObject



21
22
23
24
25
26
27
28
29
# File 'lib/tc211/termbase/glossarist/concept.rb', line 21

def register_info
  date_accepted = dates.find(&:accepted?)

  {
    "dateAccepted" => date_accepted&.date&.dup,
    "id" => uuid,
    "status" => entry_status,
  }.compact
end

#to_h(only_data: false) ⇒ Object



14
15
16
17
18
19
# File 'lib/tc211/termbase/glossarist/concept.rb', line 14

def to_h(only_data: false)
  data_hash = super()
  return data_hash if only_data

  data_hash.merge(register_info)
end

#uuidObject



7
8
9
10
11
12
# File 'lib/tc211/termbase/glossarist/concept.rb', line 7

def uuid
  @uuid ||= ::Glossarist::Utilities::UUID.uuid_v5(
    ::Glossarist::Utilities::UUID::OID_NAMESPACE,
    to_h(only_data: true).to_yaml,
  )
end