Class: Jekyll::Node
- Inherits:
-
Object
- Object
- Jekyll::Node
- Defined in:
- lib/jekyll-namespaces/tree.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#id ⇒ Object
Returns the value of attribute id.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #fill(id, title, url, doc) ⇒ Object
-
#initialize(namespace, id = "", title = "", url = "", doc = "") ⇒ Node
constructor
A new instance of Node.
- #missing ⇒ Object
- #to_s ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(namespace, id = "", title = "", url = "", doc = "") ⇒ Node
Returns a new instance of Node.
149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/jekyll-namespaces/tree.rb', line 149 def initialize(namespace, id="", title="", url="", doc="") # mandatory @namespace = namespace # optional @id = id.to_s @title = title @url = url.nil? ? "" : url @doc = doc # auto-init @children = [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
147 148 149 |
# File 'lib/jekyll-namespaces/tree.rb', line 147 def children @children end |
#doc ⇒ Object
Returns the value of attribute doc.
147 148 149 |
# File 'lib/jekyll-namespaces/tree.rb', line 147 def doc @doc end |
#id ⇒ Object
Returns the value of attribute id.
147 148 149 |
# File 'lib/jekyll-namespaces/tree.rb', line 147 def id @id end |
#namespace ⇒ Object
Returns the value of attribute namespace.
147 148 149 |
# File 'lib/jekyll-namespaces/tree.rb', line 147 def namespace @namespace end |
#title ⇒ Object
Returns the value of attribute title.
147 148 149 |
# File 'lib/jekyll-namespaces/tree.rb', line 147 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
147 148 149 |
# File 'lib/jekyll-namespaces/tree.rb', line 147 def url @url end |
Instance Method Details
#fill(id, title, url, doc) ⇒ Object
161 162 163 164 165 166 |
# File 'lib/jekyll-namespaces/tree.rb', line 161 def fill(id, title, url, doc) @id = id @title = title @url = url @doc = doc end |
#missing ⇒ Object
168 169 170 |
# File 'lib/jekyll-namespaces/tree.rb', line 168 def missing return @doc == "" end |
#to_s ⇒ Object
176 177 178 |
# File 'lib/jekyll-namespaces/tree.rb', line 176 def to_s "namespace: #{@namespace}" end |
#type ⇒ Object
172 173 174 |
# File 'lib/jekyll-namespaces/tree.rb', line 172 def type return @doc.type end |