Class: FileTree
- Includes:
- SimpleTree
- Defined in:
- lib/filetree.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Methods included from SimpleTree
#ancestors, #descendants, #family, #grandparent, #has_children?, #has_parent?, #height, #is_leaf?, #is_root?, #leaves, #siblings, #tree_rep
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/filetree.rb', line 12 def id @id end |
#identifier ⇒ Object
Returns the value of attribute identifier.
12 13 14 |
# File 'lib/filetree.rb', line 12 def identifier @identifier end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/filetree.rb', line 12 def name @name end |
Instance Method Details
#children(*args) ⇒ Array
40 41 42 43 44 45 46 |
# File 'lib/filetree.rb', line 40 def children(*args) if self.directory? _children(*args) else [] end end |
#parent ⇒ FileTree
See Pathname.parent
31 32 33 |
# File 'lib/filetree.rb', line 31 def parent FileTree.new(_parent) end |