Class: Spandx::Core::PathTraversal

Inherits:
Object
  • Object
show all
Defined in:
lib/spandx/core/path_traversal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, recursive: true) ⇒ PathTraversal

Returns a new instance of PathTraversal.



8
9
10
11
# File 'lib/spandx/core/path_traversal.rb', line 8

def initialize(root, recursive: true)
  @root = Pathname.new(root)
  @recursive = recursive
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



6
7
8
# File 'lib/spandx/core/path_traversal.rb', line 6

def root
  @root
end

Instance Method Details

#each(&block) ⇒ Object



13
14
15
# File 'lib/spandx/core/path_traversal.rb', line 13

def each(&block)
  each_file_in(root, &block)
end