Class: DoubleDoc::HtmlGenerator::SitemapItem
- Inherits:
-
Object
- Object
- DoubleDoc::HtmlGenerator::SitemapItem
- Defined in:
- lib/double_doc/html_generator.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #add_child(child) ⇒ Object
- #href ⇒ Object
-
#initialize(title, path, id = nil) ⇒ SitemapItem
constructor
A new instance of SitemapItem.
Constructor Details
#initialize(title, path, id = nil) ⇒ SitemapItem
Returns a new instance of SitemapItem.
109 110 111 112 113 114 |
# File 'lib/double_doc/html_generator.rb', line 109 def initialize(title, path, id = nil) @title = title @path = path @id = id @children = [] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
106 107 108 |
# File 'lib/double_doc/html_generator.rb', line 106 def children @children end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
106 107 108 |
# File 'lib/double_doc/html_generator.rb', line 106 def id @id end |
#parent ⇒ Object
Returns the value of attribute parent.
107 108 109 |
# File 'lib/double_doc/html_generator.rb', line 107 def parent @parent end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
106 107 108 |
# File 'lib/double_doc/html_generator.rb', line 106 def path @path end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
106 107 108 |
# File 'lib/double_doc/html_generator.rb', line 106 def title @title end |
Instance Method Details
#add_child(child) ⇒ Object
116 117 118 119 120 |
# File 'lib/double_doc/html_generator.rb', line 116 def add_child(child) child.parent = self children << child child end |
#href ⇒ Object
122 123 124 125 126 127 128 |
# File 'lib/double_doc/html_generator.rb', line 122 def href if id "#{path}##{id}" else path end end |