Class: Anamo::Fstree::Traverser

Inherits:
Object
  • Object
show all
Defined in:
lib/anamo/fstree/thor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_path = '/', writer = Writer.new, max_depth = 2, exclusions = []) ⇒ Traverser

Returns a new instance of Traverser.



56
57
58
59
60
61
# File 'lib/anamo/fstree/thor.rb', line 56

def initialize base_path = '/', writer = Writer.new, max_depth = 2, exclusions = []
  @max_depth = max_depth
  @base_path = base_path
  @writer = writer
  @exclusions = exclusions
end

Instance Attribute Details

#base_pathObject (readonly)

Returns the value of attribute base_path.



54
55
56
# File 'lib/anamo/fstree/thor.rb', line 54

def base_path
  @base_path
end

Instance Method Details

#computeObject



63
64
65
66
# File 'lib/anamo/fstree/thor.rb', line 63

def compute
  walk_path @base_path
  @writer.close
end