Class: DevSuite::DirectoryTree::Node::Directory
- Defined in:
- lib/dev_suite/directory_tree/node/directory.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Attributes inherited from Base
Instance Method Summary collapse
- #add_child(node) ⇒ Object
- #directory? ⇒ Boolean
-
#initialize(name) ⇒ Directory
constructor
A new instance of Directory.
Methods inherited from Base
Constructor Details
#initialize(name) ⇒ Directory
Returns a new instance of Directory.
9 10 11 12 |
# File 'lib/dev_suite/directory_tree/node/directory.rb', line 9 def initialize(name) super @children = [] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
7 8 9 |
# File 'lib/dev_suite/directory_tree/node/directory.rb', line 7 def children @children end |
Instance Method Details
#add_child(node) ⇒ Object
18 19 20 21 |
# File 'lib/dev_suite/directory_tree/node/directory.rb', line 18 def add_child(node) @children << node sort_children! end |
#directory? ⇒ Boolean
14 15 16 |
# File 'lib/dev_suite/directory_tree/node/directory.rb', line 14 def directory? true end |