Class: Trifle::Docs::Operations::Search
- Inherits:
-
Object
- Object
- Trifle::Docs::Operations::Search
- Defined in:
- lib/trifle/docs/operations/search.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(**keywords) ⇒ Search
constructor
A new instance of Search.
- #perform ⇒ Object
Constructor Details
#initialize(**keywords) ⇒ Search
Returns a new instance of Search.
9 10 11 12 13 |
# File 'lib/trifle/docs/operations/search.rb', line 9 def initialize(**keywords) @query = keywords.fetch(:query) @scope = keywords[:scope] # Optional scope to limit search to subfolder @config = keywords[:config] end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
7 8 9 |
# File 'lib/trifle/docs/operations/search.rb', line 7 def query @query end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
7 8 9 |
# File 'lib/trifle/docs/operations/search.rb', line 7 def scope @scope end |
Instance Method Details
#config ⇒ Object
15 16 17 |
# File 'lib/trifle/docs/operations/search.rb', line 15 def config @config || Trifle::Docs.default end |
#perform ⇒ Object
19 20 21 |
# File 'lib/trifle/docs/operations/search.rb', line 19 def perform config.harvester.search_for(query: query, scope: scope) end |