Class: TermUtils::FF::Config
- Inherits:
-
Object
- Object
- TermUtils::FF::Config
- Defined in:
- lib/term_utils/ff/config.rb
Overview
Represents a query configuration.
Instance Attribute Summary collapse
- #ignore_list ⇒ Array<Regexp>
- #max_depth ⇒ Integer?
- #min_depth ⇒ Integer?
- #sorting_compare ⇒ Proc?
-
#sorting_mode ⇒ Symbol?
Either `:forward`, `:reverse` or `nil` (default).
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
Constructs a new Config.
- #initialize_copy(other) ⇒ Object
-
#sorted? ⇒ Boolean
Returns whether the search is ordered.
Constructor Details
#initialize ⇒ Config
Constructs a new Config.
35 36 37 38 39 40 41 |
# File 'lib/term_utils/ff/config.rb', line 35 def initialize @ignore_list = [] @min_depth = nil @max_depth = nil @sorting_mode = nil @sorting_compare = nil end |
Instance Attribute Details
#ignore_list ⇒ Array<Regexp>
24 25 26 |
# File 'lib/term_utils/ff/config.rb', line 24 def ignore_list @ignore_list end |
#max_depth ⇒ Integer?
28 29 30 |
# File 'lib/term_utils/ff/config.rb', line 28 def max_depth @max_depth end |
#min_depth ⇒ Integer?
26 27 28 |
# File 'lib/term_utils/ff/config.rb', line 26 def min_depth @min_depth end |
#sorting_compare ⇒ Proc?
32 33 34 |
# File 'lib/term_utils/ff/config.rb', line 32 def sorting_compare @sorting_compare end |
#sorting_mode ⇒ Symbol?
Returns Either `:forward`, `:reverse` or `nil` (default).
30 31 32 |
# File 'lib/term_utils/ff/config.rb', line 30 def sorting_mode @sorting_mode end |
Instance Method Details
#initialize_copy(other) ⇒ Object
49 50 51 52 |
# File 'lib/term_utils/ff/config.rb', line 49 def initialize_copy(other) @ignore_list = other.ignore_list.dup super end |
#sorted? ⇒ Boolean
Returns whether the search is ordered.
45 46 47 |
# File 'lib/term_utils/ff/config.rb', line 45 def sorted? (@sorting_mode == :forward) || (@sorting_mode == :reverse) end |