Class: Coradoc::CoreModel::DefinitionItem

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

Overview

Represents a definition list item (term with definitions)

DefinitionItem contains a term and its associated definitions.

Examples:

Creating a definition item

item = CoreModel::DefinitionItem.new(
  term: "API",
  definitions: ["Application Programming Interface", "A set of protocols"]
)

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

#definitionsArray<String>

Returns the definitions for the term.

Returns:

  • (Array<String>)

    the definitions for the term



21
# File 'lib/coradoc/core_model/definition_item.rb', line 21

attribute :definitions, :string, collection: true

#termString?

Returns the term being defined.

Returns:

  • (String, nil)

    the term being defined



17
# File 'lib/coradoc/core_model/definition_item.rb', line 17

attribute :term, :string