Class: QueryStringSearch::AbstractMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/query_string_search/abstract_matcher.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



3
4
5
# File 'lib/query_string_search/abstract_matcher.rb', line 3

def attribute
  @attribute
end

#desired_valueObject

Returns the value of attribute desired_value.



3
4
5
# File 'lib/query_string_search/abstract_matcher.rb', line 3

def desired_value
  @desired_value
end

#operatorObject

Returns the value of attribute operator.



4
5
6
# File 'lib/query_string_search/abstract_matcher.rb', line 4

def operator
  @operator
end

Class Method Details

.all_reserved_wordsObject



14
15
16
# File 'lib/query_string_search/abstract_matcher.rb', line 14

def self.all_reserved_words
  descendants.each_with_object([]) { |d, ret| ret << d.reserved_words }.flatten
end

.build_me?(_) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/query_string_search/abstract_matcher.rb', line 26

def self.build_me?(_)
  true
end

.descendantsObject



10
11
12
# File 'lib/query_string_search/abstract_matcher.rb', line 10

def self.descendants
  ObjectSpace.each_object(Class).select { |klass| klass < AbstractMatcher }
end

.matchersObject



6
7
8
# File 'lib/query_string_search/abstract_matcher.rb', line 6

def self.matchers
  descendants.push(self)
end

.reserved_wordsObject



22
23
24
# File 'lib/query_string_search/abstract_matcher.rb', line 22

def self.reserved_words
  []
end

Instance Method Details

#comparisonObject



34
35
36
# File 'lib/query_string_search/abstract_matcher.rb', line 34

def comparison
  @comparison ||= QueryStringSearch::Comparator::ComparisonFactory.build(self)
end

#match?(_) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/query_string_search/abstract_matcher.rb', line 18

def match?(_)
  false
end