Class: MatchAttribute
Instance Attribute Summary
#attribute, #desired_value, #operator
Class Method Summary
collapse
Instance Method Summary
collapse
all_reserved_words, #comparison, descendants, matchers
Class Method Details
.build_me?(search_option) ⇒ Boolean
16
17
18
|
# File 'lib/query_string_search/matchers/match_attribute.rb', line 16
def self.build_me?(search_option)
reserved_words.any? { |r| r.match(search_option.desired_value) }
end
|
.reserved_words ⇒ Object
9
10
11
12
13
14
|
# File 'lib/query_string_search/matchers/match_attribute.rb', line 9
def self.reserved_words
[
/^true$/,
/^all$/
]
end
|
Instance Method Details
#match?(data) ⇒ Boolean
2
3
4
5
6
7
|
# File 'lib/query_string_search/matchers/match_attribute.rb', line 2
def match?(data)
match_with_contingency do
actual_value(data) == true ||
Array(actual_value(data)).any?
end
end
|