Class: Yuriita::Definitions::Single

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options:) ⇒ Single

Returns a new instance of Single.



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

def initialize(options:)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#apply(query:) ⇒ Object



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

def apply(query:)
  filter = selected_filter(query)

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