Class: Rakit::Markdown::OutlineNode

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

Overview

Single node in the outline tree. id/href may be set by normalization.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: "", id: nil, href: nil, source_path: nil, children: nil) ⇒ OutlineNode

Returns a new instance of OutlineNode.



29
30
31
# File 'lib/rakit/markdown.rb', line 29

def initialize(title: "", id: nil, href: nil, source_path: nil, children: nil)
  super(title: title.to_s, id: id, href: href, source_path: source_path, children: children || [])
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



28
29
30
# File 'lib/rakit/markdown.rb', line 28

def children
  @children
end

#hrefObject

Returns the value of attribute href

Returns:

  • (Object)

    the current value of href



28
29
30
# File 'lib/rakit/markdown.rb', line 28

def href
  @href
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



28
29
30
# File 'lib/rakit/markdown.rb', line 28

def id
  @id
end

#source_pathObject

Returns the value of attribute source_path

Returns:

  • (Object)

    the current value of source_path



28
29
30
# File 'lib/rakit/markdown.rb', line 28

def source_path
  @source_path
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



28
29
30
# File 'lib/rakit/markdown.rb', line 28

def title
  @title
end