Class: Coradoc::CoreModel::Term

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/core_model/term.rb

Overview

Represents a definition term in a document

Terms are used in definition lists, glossaries, and terminology sections. They can have various types (acronym, symbol, preferred, etc.) and support multi-language content.

Examples:

Creating a simple term

term = CoreModel::Term.new(
  text: "API",
  type: "acronym",
  definition: "Application Programming Interface"
)

Creating a multi-language term

term = CoreModel::Term.new(
  text: "computer",
  type: "preferred",
  lang: "en",
  definition: "An electronic device for processing data"
)

Instance Attribute Summary collapse

Attributes inherited from Base

#element_attributes, #id, #metadata_entries, #title

Method Summary

Methods inherited from Base

#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata

Instance Attribute Details

#definitionString?

Returns definition of the term.

Returns:

  • (String, nil)

    definition of the term



40
# File 'lib/coradoc/core_model/term.rb', line 40

attribute :definition, :string

#langString

Returns language code (default: ‘en’).

Returns:

  • (String)

    language code (default: ‘en’)



36
# File 'lib/coradoc/core_model/term.rb', line 36

attribute :lang, :string, default: -> { 'en' }

#sourceString?

Returns source reference for the term.

Returns:

  • (String, nil)

    source reference for the term



44
# File 'lib/coradoc/core_model/term.rb', line 44

attribute :source, :string

#textString?

Returns the term text.

Returns:

  • (String, nil)

    the term text



28
# File 'lib/coradoc/core_model/term.rb', line 28

attribute :text, :string

#typeString?

Returns term type (‘acronym’, ‘symbol’, ‘preferred’, ‘admitted’, ‘deprecated’).

Returns:

  • (String, nil)

    term type (‘acronym’, ‘symbol’, ‘preferred’, ‘admitted’, ‘deprecated’)



32
# File 'lib/coradoc/core_model/term.rb', line 32

attribute :type, :string