Class: Coradoc::CoreModel::TocEntry

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

Overview

Re-open TocEntry to properly type children now that TocEntry is defined

Instance Attribute Summary collapse

Attributes inherited from Base

#element_attributes, #metadata_entries

Method Summary

Methods inherited from Base

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

Instance Attribute Details

#childrenArray<TocEntry>

Returns nested child entries.

Returns:

  • (Array<TocEntry>)

    nested child entries



82
# File 'lib/coradoc/core_model/toc.rb', line 82

attribute :children, :string, collection: true

#idString?

Returns the anchor ID for linking.

Returns:

  • (String, nil)

    the anchor ID for linking



66
# File 'lib/coradoc/core_model/toc.rb', line 66

attribute :id, :string

#levelInteger

Returns the heading level (1-6).

Returns:

  • (Integer)

    the heading level (1-6)



74
# File 'lib/coradoc/core_model/toc.rb', line 74

attribute :level, :integer, default: -> { 1 }

#numberString?

Returns the section number (e.g., “1.2.3”).

Returns:

  • (String, nil)

    the section number (e.g., “1.2.3”)



78
# File 'lib/coradoc/core_model/toc.rb', line 78

attribute :number, :string

#titleString?

Returns the heading text.

Returns:

  • (String, nil)

    the heading text



70
# File 'lib/coradoc/core_model/toc.rb', line 70

attribute :title, :string