Class: TermUtils::FF::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/term_utils/ff/config.rb

Overview

Represents a query configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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_listArray<Regexp>

Returns:

  • (Array<Regexp>)


24
25
26
# File 'lib/term_utils/ff/config.rb', line 24

def ignore_list
  @ignore_list
end

#max_depthInteger?

Returns:

  • (Integer, nil)


28
29
30
# File 'lib/term_utils/ff/config.rb', line 28

def max_depth
  @max_depth
end

#min_depthInteger?

Returns:

  • (Integer, nil)


26
27
28
# File 'lib/term_utils/ff/config.rb', line 26

def min_depth
  @min_depth
end

#sorting_compareProc?

Returns:

  • (Proc, nil)


32
33
34
# File 'lib/term_utils/ff/config.rb', line 32

def sorting_compare
  @sorting_compare
end

#sorting_modeSymbol?

Returns Either `:forward`, `:reverse` or `nil` (default).

Returns:

  • (Symbol, nil)

    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.

Returns:

  • (Boolean)


45
46
47
# File 'lib/term_utils/ff/config.rb', line 45

def sorted?
  (@sorting_mode == :forward) || (@sorting_mode == :reverse)
end