Module: SearchCopGrammar::Nodes::Base
- Included in:
- Binary, Collection, FulltextExpression, MatchesFulltext, Not
- Defined in:
- lib/search_cop_grammar/nodes.rb
Instance Method Summary collapse
- #and(node) ⇒ Object
- #can_flatten? ⇒ Boolean
- #can_group? ⇒ Boolean
- #can_optimize? ⇒ Boolean
- #finalize! ⇒ Object
- #flatten! ⇒ Object
- #fulltext? ⇒ Boolean
- #group! ⇒ Object
- #nodes ⇒ Object
- #not ⇒ Object
- #optimize! ⇒ Object
- #or(node) ⇒ Object
Instance Method Details
#and(node) ⇒ Object
6 7 8 |
# File 'lib/search_cop_grammar/nodes.rb', line 6 def and(node) And.new self, node end |
#can_flatten? ⇒ Boolean
18 19 20 |
# File 'lib/search_cop_grammar/nodes.rb', line 18 def can_flatten? false end |
#can_group? ⇒ Boolean
26 27 28 |
# File 'lib/search_cop_grammar/nodes.rb', line 26 def can_group? false end |
#can_optimize? ⇒ Boolean
38 39 40 |
# File 'lib/search_cop_grammar/nodes.rb', line 38 def can_optimize? can_flatten? || can_group? end |
#finalize! ⇒ Object
48 49 50 |
# File 'lib/search_cop_grammar/nodes.rb', line 48 def finalize! self end |
#flatten! ⇒ Object
22 23 24 |
# File 'lib/search_cop_grammar/nodes.rb', line 22 def flatten! self end |
#fulltext? ⇒ Boolean
34 35 36 |
# File 'lib/search_cop_grammar/nodes.rb', line 34 def fulltext? false end |
#group! ⇒ Object
30 31 32 |
# File 'lib/search_cop_grammar/nodes.rb', line 30 def group! self end |
#nodes ⇒ Object
52 53 54 |
# File 'lib/search_cop_grammar/nodes.rb', line 52 def nodes [] end |
#optimize! ⇒ Object
42 43 44 45 46 |
# File 'lib/search_cop_grammar/nodes.rb', line 42 def optimize! flatten!.group! while can_optimize? finalize! end |