Class: Yuriita::Definitions::Scope
- Inherits:
-
Object
- Object
- Yuriita::Definitions::Scope
- Defined in:
- lib/yuriita/definitions/scope.rb
Instance Attribute Summary collapse
-
#combination ⇒ Object
readonly
Returns the value of attribute combination.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #apply(query:) ⇒ Object
-
#initialize(options:, combination:) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(options:, combination:) ⇒ Scope
Returns a new instance of Scope.
6 7 8 9 |
# File 'lib/yuriita/definitions/scope.rb', line 6 def initialize(options:, combination:) @options = @combination = combination end |
Instance Attribute Details
#combination ⇒ Object (readonly)
Returns the value of attribute combination.
4 5 6 |
# File 'lib/yuriita/definitions/scope.rb', line 4 def combination @combination end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/yuriita/definitions/scope.rb', line 4 def @options end |
Instance Method Details
#apply(query:) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/yuriita/definitions/scope.rb', line 11 def apply(query:) filters = selected_filters(query) keywords = query.keywords if keywords.present? Clauses::Search.new( filters: filters, keywords: keywords, combination: combination, ) else Clauses::Identity.new end end |