Class: Yuriita::Definitions::Multiple

Inherits:
Object
  • Object
show all
Defined in:
lib/yuriita/definitions/multiple.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options:, combination:) ⇒ Multiple

Returns a new instance of Multiple.



6
7
8
9
# File 'lib/yuriita/definitions/multiple.rb', line 6

def initialize(options:, combination:)
  @options = options
  @combination = combination
end

Instance Attribute Details

#combinationObject (readonly)

Returns the value of attribute combination.



4
5
6
# File 'lib/yuriita/definitions/multiple.rb', line 4

def combination
  @combination
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/yuriita/definitions/multiple.rb', line 4

def options
  @options
end

Instance Method Details

#apply(query:) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/yuriita/definitions/multiple.rb', line 11

def apply(query:)
  filters = selected_filters(query)

  if filters.present?
    Clauses::Filter.new(filters: filters, combination: combination)
  else
    Clauses::Identity.new
  end
end