Class: Glossarist::RelatedConcept

Inherits:
Model
  • Object
show all
Includes:
Utilities::Enum
Defined in:
lib/glossarist/related_concept.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utilities::Enum

extended, included

Methods inherited from Model

from_h, #initialize, new, #set_attribute

Constructor Details

This class inherits a constructor from Glossarist::Model

Instance Attribute Details

#contentString

Returns:

  • (String)


10
11
12
# File 'lib/glossarist/related_concept.rb', line 10

def content
  @content
end

#refCitation

Reference to the related concept.

Returns:



14
15
16
# File 'lib/glossarist/related_concept.rb', line 14

def ref
  @ref
end

Instance Method Details

#to_hObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/glossarist/related_concept.rb', line 20

def to_h
  reference = ref&.to_h
  reference&.merge!(reference&.delete("ref"))

  {
    "type" => type.to_s,
    "content" => content,
    "ref" => reference,
  }.compact
end