Class: QueryStringSearch::Comparator::AbstractComparison
- Inherits:
-
Object
- Object
- QueryStringSearch::Comparator::AbstractComparison
- Defined in:
- lib/query_string_search/abstract_comparison.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#operator ⇒ Object
Returns the value of attribute operator.
-
#other ⇒ Object
Returns the value of attribute other.
-
#subject ⇒ Object
Returns the value of attribute subject.
Class Method Summary collapse
- .all_reserved_operators ⇒ Object
- .build_me?(_) ⇒ Boolean
- .comparisons ⇒ Object
- .descendants ⇒ Object
- .reserved_operators ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#operator ⇒ Object
Returns the value of attribute operator.
6 7 8 |
# File 'lib/query_string_search/abstract_comparison.rb', line 6 def operator @operator end |
#other ⇒ Object
Returns the value of attribute other.
6 7 8 |
# File 'lib/query_string_search/abstract_comparison.rb', line 6 def other @other end |
#subject ⇒ Object
Returns the value of attribute subject.
6 7 8 |
# File 'lib/query_string_search/abstract_comparison.rb', line 6 def subject @subject end |
Class Method Details
.all_reserved_operators ⇒ Object
16 17 18 |
# File 'lib/query_string_search/abstract_comparison.rb', line 16 def self.all_reserved_operators descendants.each_with_object([]) { |d, ret| ret << d.reserved_operators }.flatten end |
.build_me?(_) ⇒ Boolean
32 33 34 |
# File 'lib/query_string_search/abstract_comparison.rb', line 32 def self.build_me?(_) true end |
.comparisons ⇒ Object
8 9 10 |
# File 'lib/query_string_search/abstract_comparison.rb', line 8 def self.comparisons descendants.push(self) end |
.descendants ⇒ Object
12 13 14 |
# File 'lib/query_string_search/abstract_comparison.rb', line 12 def self.descendants ObjectSpace.each_object(Class).select { |klass| klass < AbstractComparison } end |
.reserved_operators ⇒ Object
20 21 22 |
# File 'lib/query_string_search/abstract_comparison.rb', line 20 def self.reserved_operators [] end |
Instance Method Details
#compare ⇒ Object
28 29 30 |
# File 'lib/query_string_search/abstract_comparison.rb', line 28 def compare false end |
#normalize(unnormalized) ⇒ Object
24 25 26 |
# File 'lib/query_string_search/abstract_comparison.rb', line 24 def normalize(unnormalized) Array(unnormalized).map(&:to_s).map(&:upcase) end |