Class: Rakit::Markdown::Outline

Inherits:
Struct
  • Object
show all
Defined in:
lib/rakit/markdown.rb

Overview

In-memory outline for rendering (010). title: optional root title; nodes: top-level OutlineNode list.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: nil, nodes: nil) ⇒ Outline

Returns a new instance of Outline.



22
23
24
# File 'lib/rakit/markdown.rb', line 22

def initialize(title: nil, nodes: nil)
  super(title: title.to_s.strip, nodes: nodes || [])
end

Instance Attribute Details

#nodesObject

Returns the value of attribute nodes

Returns:

  • (Object)

    the current value of nodes



21
22
23
# File 'lib/rakit/markdown.rb', line 21

def nodes
  @nodes
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



21
22
23
# File 'lib/rakit/markdown.rb', line 21

def title
  @title
end