Class: MatchAttribute

Inherits:
QueryStringSearch::AbstractMatcher show all
Defined in:
lib/query_string_search/matchers/match_attribute.rb

Instance Attribute Summary

Attributes inherited from QueryStringSearch::AbstractMatcher

#attribute, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from QueryStringSearch::AbstractMatcher

all_reserved_words, descendants, #initialize, matchers

Constructor Details

This class inherits a constructor from QueryStringSearch::AbstractMatcher

Class Method Details

.build_me?(_, search_param) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.build_me?(_, search_param)
  reserved_words.include?(search_param)
end

.reserved_wordsObject



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

def self.reserved_words
  %w(true all)
end

Instance Method Details

#match?(target) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/query_string_search/matchers/match_attribute.rb', line 2

def match?(target)
  match_with_contingency { target.public_send(attribute) }
end