Class: Rfd::TreeNode
- Inherits:
-
Struct
- Object
- Struct
- Rfd::TreeNode
- Defined in:
- lib/rfd/navigation_window.rb
Overview
Tree node for directory tree browser
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#expanded ⇒ Object
Returns the value of attribute expanded.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#path ⇒ Object
Returns the value of attribute path.
-
#relative_path ⇒ Object
Returns the value of attribute relative_path.
Instance Method Summary collapse
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children
5 6 7 |
# File 'lib/rfd/navigation_window.rb', line 5 def children @children end |
#depth ⇒ Object
Returns the value of attribute depth
5 6 7 |
# File 'lib/rfd/navigation_window.rb', line 5 def depth @depth end |
#expanded ⇒ Object
Returns the value of attribute expanded
5 6 7 |
# File 'lib/rfd/navigation_window.rb', line 5 def end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/rfd/navigation_window.rb', line 5 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent
5 6 7 |
# File 'lib/rfd/navigation_window.rb', line 5 def parent @parent end |
#path ⇒ Object
Returns the value of attribute path
5 6 7 |
# File 'lib/rfd/navigation_window.rb', line 5 def path @path end |
#relative_path ⇒ Object
Returns the value of attribute relative_path
5 6 7 |
# File 'lib/rfd/navigation_window.rb', line 5 def relative_path @relative_path end |
Instance Method Details
#has_subdirs? ⇒ Boolean
6 7 8 9 10 11 12 |
# File 'lib/rfd/navigation_window.rb', line 6 def has_subdirs? return false unless File.directory?(path) @has_subdirs = Dir.children(path).any? { |c| File.directory?(File.join(path, c)) } if @has_subdirs.nil? @has_subdirs rescue Errno::EACCES, Errno::ENOENT, Errno::EPERM false end |