Class: Yuriita::Definitions::Dynamic

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

Instance Method Summary collapse

Constructor Details

#initialize(filter:) ⇒ Dynamic

Returns a new instance of Dynamic.



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

def initialize(filter:)
  @filter = filter
end

Instance Method Details

#apply(query:) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/yuriita/definitions/dynamic.rb', line 8

def apply(query:)
  input = select_input(query)

  if input.present?
    Clauses::Dynamic.new(filter: filter, input: input)
  else
    Clauses::Identity.new
  end
end