Class: Rokaki::FilterModel::NestedFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/rokaki/filter_model/nested_filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filter_key_object:, prefix:, infix:, like_semantics:, i_like_semantics:, db:, mode: :and) ⇒ NestedFilter

Returns a new instance of NestedFilter.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rokaki/filter_model/nested_filter.rb', line 7

def initialize(filter_key_object:, prefix:, infix:, like_semantics:, i_like_semantics:, db:, mode: :and)
  @filter_key_object = filter_key_object
  @prefix = prefix
  @infix = infix
  @like_semantics = like_semantics
  @i_like_semantics = i_like_semantics
  @filter_methods = []
  @filter_templates = []
  @db = db
  @mode = mode
end

Instance Attribute Details

#dbObject (readonly)

Returns the value of attribute db.



18
19
20
# File 'lib/rokaki/filter_model/nested_filter.rb', line 18

def db
  @db
end

#filter_key_objectObject (readonly)

Returns the value of attribute filter_key_object.



18
19
20
# File 'lib/rokaki/filter_model/nested_filter.rb', line 18

def filter_key_object
  @filter_key_object
end

#filter_methodsObject

Returns the value of attribute filter_methods.



19
20
21
# File 'lib/rokaki/filter_model/nested_filter.rb', line 19

def filter_methods
  @filter_methods
end

#filter_templatesObject

Returns the value of attribute filter_templates.



19
20
21
# File 'lib/rokaki/filter_model/nested_filter.rb', line 19

def filter_templates
  @filter_templates
end

#i_like_semanticsObject (readonly)

Returns the value of attribute i_like_semantics.



18
19
20
# File 'lib/rokaki/filter_model/nested_filter.rb', line 18

def i_like_semantics
  @i_like_semantics
end

#infixObject (readonly)

Returns the value of attribute infix.



18
19
20
# File 'lib/rokaki/filter_model/nested_filter.rb', line 18

def infix
  @infix
end

#like_semanticsObject (readonly)

Returns the value of attribute like_semantics.



18
19
20
# File 'lib/rokaki/filter_model/nested_filter.rb', line 18

def like_semantics
  @like_semantics
end

#modeObject (readonly)

Returns the value of attribute mode.



18
19
20
# File 'lib/rokaki/filter_model/nested_filter.rb', line 18

def mode
  @mode
end

#prefixObject (readonly)

Returns the value of attribute prefix.



18
19
20
# File 'lib/rokaki/filter_model/nested_filter.rb', line 18

def prefix
  @prefix
end

Instance Method Details

#callObject

_chain_nested_filter



21
22
23
24
25
# File 'lib/rokaki/filter_model/nested_filter.rb', line 21

def call # _chain_nested_filter
  filter_key_object.keys.each do |key|
    deep_chain([key], filter_key_object[key])
  end
end