Class: Ace::Search::Models::SearchOptions
- Inherits:
-
Object
- Object
- Ace::Search::Models::SearchOptions
- Defined in:
- lib/ace/search/models/search_options.rb
Overview
SearchOptions encapsulates all search configuration parameters This is a model - pure data structure
Instance Attribute Summary collapse
-
#after_context ⇒ Object
Returns the value of attribute after_context.
-
#before ⇒ Object
Returns the value of attribute before.
-
#before_context ⇒ Object
Returns the value of attribute before_context.
-
#case_insensitive ⇒ Object
Returns the value of attribute case_insensitive.
-
#context ⇒ Object
Returns the value of attribute context.
-
#exclude ⇒ Object
Returns the value of attribute exclude.
-
#files_with_matches ⇒ Object
Returns the value of attribute files_with_matches.
-
#format ⇒ Object
Returns the value of attribute format.
-
#glob ⇒ Object
Returns the value of attribute glob.
-
#hidden ⇒ Object
Returns the value of attribute hidden.
-
#include ⇒ Object
Returns the value of attribute include.
-
#interactive ⇒ Object
Returns the value of attribute interactive.
-
#max_results ⇒ Object
Returns the value of attribute max_results.
-
#multiline ⇒ Object
Returns the value of attribute multiline.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#preset ⇒ Object
Returns the value of attribute preset.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#since ⇒ Object
Returns the value of attribute since.
-
#type ⇒ Object
Returns the value of attribute type.
-
#whole_word ⇒ Object
Returns the value of attribute whole_word.
Instance Method Summary collapse
-
#initialize(pattern, **options) ⇒ SearchOptions
constructor
A new instance of SearchOptions.
- #to_h ⇒ Object
Constructor Details
#initialize(pattern, **options) ⇒ SearchOptions
Returns a new instance of SearchOptions.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ace/search/models/search_options.rb', line 16 def initialize(pattern, **) @pattern = pattern @type = [:type] || :auto @case_insensitive = [:case_insensitive] || false @whole_word = [:whole_word] || false @multiline = [:multiline] || false @context = [:context] || 0 @before_context = [:before_context] @after_context = [:after_context] @glob = [:glob] @exclude = [:exclude] || [] @include = [:include] || [] @max_results = [:max_results] @hidden = [:hidden] || false @files_with_matches = [:files_with_matches] || false @scope = [:scope] @since = [:since] @before = [:before] @format = [:format] || :text @interactive = [:interactive] || false @preset = [:preset] end |
Instance Attribute Details
#after_context ⇒ Object
Returns the value of attribute after_context.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def after_context @after_context end |
#before ⇒ Object
Returns the value of attribute before.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def before @before end |
#before_context ⇒ Object
Returns the value of attribute before_context.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def before_context @before_context end |
#case_insensitive ⇒ Object
Returns the value of attribute case_insensitive.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def case_insensitive @case_insensitive end |
#context ⇒ Object
Returns the value of attribute context.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def context @context end |
#exclude ⇒ Object
Returns the value of attribute exclude.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def exclude @exclude end |
#files_with_matches ⇒ Object
Returns the value of attribute files_with_matches.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def files_with_matches @files_with_matches end |
#format ⇒ Object
Returns the value of attribute format.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def format @format end |
#glob ⇒ Object
Returns the value of attribute glob.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def glob @glob end |
#hidden ⇒ Object
Returns the value of attribute hidden.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def hidden @hidden end |
#include ⇒ Object
Returns the value of attribute include.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def include @include end |
#interactive ⇒ Object
Returns the value of attribute interactive.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def interactive @interactive end |
#max_results ⇒ Object
Returns the value of attribute max_results.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def max_results @max_results end |
#multiline ⇒ Object
Returns the value of attribute multiline.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def multiline @multiline end |
#pattern ⇒ Object
Returns the value of attribute pattern.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def pattern @pattern end |
#preset ⇒ Object
Returns the value of attribute preset.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def preset @preset end |
#scope ⇒ Object
Returns the value of attribute scope.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def scope @scope end |
#since ⇒ Object
Returns the value of attribute since.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def since @since end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def type @type end |
#whole_word ⇒ Object
Returns the value of attribute whole_word.
9 10 11 |
# File 'lib/ace/search/models/search_options.rb', line 9 def whole_word @whole_word end |
Instance Method Details
#to_h ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ace/search/models/search_options.rb', line 39 def to_h { pattern: @pattern, type: @type, case_insensitive: @case_insensitive, whole_word: @whole_word, multiline: @multiline, context: @context, before_context: @before_context, after_context: @after_context, glob: @glob, exclude: @exclude, include: @include, max_results: @max_results, hidden: @hidden, files_with_matches: @files_with_matches, scope: @scope, since: @since, before: @before, format: @format, interactive: @interactive, preset: @preset } end |