Class: TermUtils::FF::Query
- Inherits:
-
Object
- Object
- TermUtils::FF::Query
- Defined in:
- lib/term_utils/ff/query.rb
Overview
Represents a file system query.
Instance Method Summary collapse
-
#exec(path) ⇒ TermUtils::FF::Cursor
Executes this one.
-
#ignore(regexp) ⇒ TermUtils::FF::Query
Adds a Regexp to ignore.
-
#initialize ⇒ Query
constructor
A new instance of Query.
- #initialize_copy(other) ⇒ Object
-
#max_depth(depth) ⇒ TermUtils::FF::Query
Sets a maximum depth.
-
#min_depth(depth) ⇒ TermUtils::FF::Query
Sets a minimum depth.
-
#sort(sorted = true) ⇒ TermUtils::FF::Query
Sets whether results shall be sorted.
Constructor Details
Instance Method Details
#exec(path) ⇒ TermUtils::FF::Cursor
Executes this one.
61 62 63 |
# File 'lib/term_utils/ff/query.rb', line 61 def exec(path) TermUtils::FF::Cursor.new(@config.dup, path).bootstrap end |
#ignore(regexp) ⇒ TermUtils::FF::Query
Adds a Regexp to ignore.
33 34 35 36 |
# File 'lib/term_utils/ff/query.rb', line 33 def ignore(regexp) @config.ignore_list << regexp self end |
#initialize_copy(other) ⇒ Object
26 27 28 29 |
# File 'lib/term_utils/ff/query.rb', line 26 def initialize_copy(other) @config = other.config.dup super end |
#max_depth(depth) ⇒ TermUtils::FF::Query
Sets a maximum depth.
47 48 49 50 |
# File 'lib/term_utils/ff/query.rb', line 47 def max_depth(depth) @config.max_depth = depth self end |
#min_depth(depth) ⇒ TermUtils::FF::Query
Sets a minimum depth.
40 41 42 43 |
# File 'lib/term_utils/ff/query.rb', line 40 def min_depth(depth) @config.min_depth = depth self end |
#sort(sorted = true) ⇒ TermUtils::FF::Query
Sets whether results shall be sorted.
54 55 56 57 |
# File 'lib/term_utils/ff/query.rb', line 54 def sort(sorted = true) @config.sorted = sorted self end |