Class: TracWiki::Node
- Inherits:
-
Object
- Object
- TracWiki::Node
- Defined in:
- lib/trac-wiki/tree.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
Returns the value of attribute attrs.
-
#cont ⇒ Object
Returns the value of attribute cont.
-
#par ⇒ Object
Returns the value of attribute par.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
- #add(cont) ⇒ Object
-
#initialize(tag_name, par = nil, attrs = {}, cont = []) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(tag_name, par = nil, attrs = {}, cont = []) ⇒ Node
Returns a new instance of Node.
18 19 20 21 22 23 24 25 |
# File 'lib/trac-wiki/tree.rb', line 18 def initialize(tag_name, par=nil, attrs={}, cont=[]) @tag = nil @tag = tag_name.to_sym if tag_name @par = par cont = [ cont ] if cont.is_a? String @cont = cont || [] @attrs = attrs || {} end |
Instance Attribute Details
#attrs ⇒ Object
Returns the value of attribute attrs.
17 18 19 |
# File 'lib/trac-wiki/tree.rb', line 17 def attrs @attrs end |
#cont ⇒ Object
Returns the value of attribute cont.
16 17 18 |
# File 'lib/trac-wiki/tree.rb', line 16 def cont @cont end |
#par ⇒ Object
Returns the value of attribute par.
15 16 17 |
# File 'lib/trac-wiki/tree.rb', line 15 def par @par end |
#tag ⇒ Object
Returns the value of attribute tag.
14 15 16 |
# File 'lib/trac-wiki/tree.rb', line 14 def tag @tag end |
Instance Method Details
#add(cont) ⇒ Object
27 28 29 |
# File 'lib/trac-wiki/tree.rb', line 27 def add(cont) @cont << cont end |