Class: DevSuite::DirectoryTree::Node::Base

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

Direct Known Subclasses

Directory, File, PermissionDenied

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/dev_suite/directory_tree/node/base.rb', line 9

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/dev_suite/directory_tree/node/base.rb', line 7

def name
  @name
end

Instance Method Details

#childrenObject



21
22
23
# File 'lib/dev_suite/directory_tree/node/base.rb', line 21

def children
  []
end

#directory?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/dev_suite/directory_tree/node/base.rb', line 13

def directory?
  false
end

#file?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/dev_suite/directory_tree/node/base.rb', line 17

def file?
  false
end

#hidden?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/dev_suite/directory_tree/node/base.rb', line 25

def hidden?
  @name.start_with?(".")
end