Class: DevSuite::DirectoryTree::Node::Directory

Inherits:
Base
  • Object
show all
Defined in:
lib/dev_suite/directory_tree/node/directory.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#file?, #hidden?

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

#childrenObject (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

Returns:

  • (Boolean)


14
15
16
# File 'lib/dev_suite/directory_tree/node/directory.rb', line 14

def directory?
  true
end