Class: QueryStringSearch::Comparator::Inequality
Instance Attribute Summary
#operator, #other, #subject
Class Method Summary
collapse
Instance Method Summary
collapse
all_reserved_operators, comparisons, descendants
Class Method Details
.build_me?(matcher) ⇒ Boolean
16
17
18
|
# File 'lib/query_string_search/comparisons/inequality.rb', line 16
def self.build_me?(matcher)
reserved_operators.include?(matcher.operator)
end
|
.reserved_operators ⇒ Object
12
13
14
|
# File 'lib/query_string_search/comparisons/inequality.rb', line 12
def self.reserved_operators
[:<, :>, :<=, :>=]
end
|
Instance Method Details
#compare(other) ⇒ Object
4
5
6
|
# File 'lib/query_string_search/comparisons/inequality.rb', line 4
def compare(other)
normalize(other).public_send(operator, normalize(subject))
end
|
#normalize(unnormalized) ⇒ Object
8
9
10
|
# File 'lib/query_string_search/comparisons/inequality.rb', line 8
def normalize(unnormalized)
unnormalized.to_i
end
|