Class: EacFs::Traverser

Inherits:
Object show all
Defined in:
lib/eac_fs/traverser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Traverser

Returns a new instance of Traverser.



7
8
9
10
11
# File 'lib/eac_fs/traverser.rb', line 7

def initialize(options = {})
  options.each do |accessor, value|
    send("#{accessor}=", value)
  end
end

Instance Attribute Details

#check_directoryObject

Returns the value of attribute check_directory.



5
6
7
# File 'lib/eac_fs/traverser.rb', line 5

def check_directory
  @check_directory
end

#check_fileObject

Returns the value of attribute check_file.



5
6
7
# File 'lib/eac_fs/traverser.rb', line 5

def check_file
  @check_file
end

#hidden_directoriesObject

Returns the value of attribute hidden_directories.



5
6
7
# File 'lib/eac_fs/traverser.rb', line 5

def hidden_directories
  @hidden_directories
end

#recursiveObject

Returns the value of attribute recursive.



5
6
7
# File 'lib/eac_fs/traverser.rb', line 5

def recursive
  @recursive
end

#sortObject

Returns the value of attribute sort.



5
6
7
# File 'lib/eac_fs/traverser.rb', line 5

def sort
  @sort
end

Instance Method Details

#check_path(path) ⇒ Object



13
14
15
16
# File 'lib/eac_fs/traverser.rb', line 13

def check_path(path)
  path = ::Pathname.new(path.to_s) unless path.is_a?(::Pathname)
  internal_check_path(path, 0)
end

#hidden_directories?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/eac_fs/traverser.rb', line 18

def hidden_directories?
  boolean_value(hidden_directories)
end

#recursive?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/eac_fs/traverser.rb', line 22

def recursive?
  boolean_value(recursive)
end

#sort?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/eac_fs/traverser.rb', line 26

def sort?
  boolean_value(sort)
end