Class: Wallaby::Node
- Inherits:
-
Object
- Object
- Wallaby::Node
- Defined in:
- lib/tree/wallaby/node.rb
Overview
To present classes in tree structure.
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Represent the current class.
-
#parent ⇒ Object
Represent the parent class of current class.
Instance Method Summary collapse
-
#children ⇒ Array<Class>
A list of children classes.
-
#initialize(klass) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(klass) ⇒ Node
Returns a new instance of Node.
16 17 18 |
# File 'lib/tree/wallaby/node.rb', line 16 def initialize(klass) @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Represent the current class
8 9 10 |
# File 'lib/tree/wallaby/node.rb', line 8 def klass @klass end |
#parent ⇒ Object
Represent the parent class of current class
11 12 13 |
# File 'lib/tree/wallaby/node.rb', line 11 def parent @parent end |
Instance Method Details
#children ⇒ Array<Class>
Returns a list of children classes.
21 22 23 |
# File 'lib/tree/wallaby/node.rb', line 21 def children @children ||= [] end |