Class: FileTree

Inherits:
Pathname show all
Includes:
SimpleTree
Defined in:
lib/filetree.rb

Instance Attribute Summary collapse

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

#idObject

Returns the value of attribute id.



12
13
14
# File 'lib/filetree.rb', line 12

def id
  @id
end

#identifierObject

Returns the value of attribute identifier.



12
13
14
# File 'lib/filetree.rb', line 12

def identifier
  @identifier
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/filetree.rb', line 12

def name
  @name
end

Instance Method Details

#children(*args) ⇒ Object

See Pathname#children



34
35
36
37
38
39
40
# File 'lib/filetree.rb', line 34

def children(*args)
  if self.directory?
    _children(*args)
  else
    []
  end
end

#parentObject

See Pathname#parent



28
29
30
# File 'lib/filetree.rb', line 28

def parent
  FileTree.new(_parent)
end