Class: Glossarist::RelatedConcept
- Includes:
- Utilities::Enum
- Defined in:
- lib/glossarist/related_concept.rb
Instance Attribute Summary collapse
- #content ⇒ String
-
#ref ⇒ Citation
Reference to the related concept.
Instance Method Summary collapse
Methods included from Utilities::Enum
Methods inherited from Model
from_h, #initialize, new, #set_attribute
Constructor Details
This class inherits a constructor from Glossarist::Model
Instance Attribute Details
#content ⇒ String
10 11 12 |
# File 'lib/glossarist/related_concept.rb', line 10 def content @content end |
#ref ⇒ Citation
Reference to the related concept.
14 15 16 |
# File 'lib/glossarist/related_concept.rb', line 14 def ref @ref end |
Instance Method Details
#to_h ⇒ Object
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 |