Class: FileTree
- Includes:
- SimpleTree
- Defined in:
- lib/filetree.rb
Constant Summary collapse
- VERSION =
"1.0.0"
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
-
#children(*args) ⇒ Array
See Pathname.children.
-
#join(*args) ⇒ Object
Joins the given pathnames onto self to create a new FileTree object.
-
#parent ⇒ FileTree
See Pathname.parent.
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.
14 15 16 |
# File 'lib/filetree.rb', line 14 def id @id end |
#identifier ⇒ Object
Returns the value of attribute identifier.
14 15 16 |
# File 'lib/filetree.rb', line 14 def identifier @identifier end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/filetree.rb', line 14 def name @name end |
Instance Method Details
#children(*args) ⇒ Array
42 43 44 45 46 47 48 |
# File 'lib/filetree.rb', line 42 def children(*args) if self.directory? _children(*args) else [] end end |
#join(*args) ⇒ Object
Joins the given pathnames onto self to create a new FileTree object.
52 53 54 |
# File 'lib/filetree.rb', line 52 def join(*args) FileTree.new(super(*args)) end |
#parent ⇒ FileTree
See Pathname.parent
33 34 35 |
# File 'lib/filetree.rb', line 33 def parent FileTree.new(_parent) end |