class SearchCopGrammar::BaseNode

Attributes

query_info[W]
query_options[W]

Public Instance Methods

collection_for(key) click to toggle source
# File lib/search_cop_grammar.rb, line 24
def collection_for(key)
  raise(SearchCop::UnknownColumn, "Unknown column #{key}") if query_info.scope.reflection.attributes[key].nil?

  Attributes::Collection.new query_info, key
end
elements() click to toggle source
Calls superclass method
# File lib/search_cop_grammar.rb, line 20
def elements
  super.reject { |element| element.instance_of?(Treetop::Runtime::SyntaxNode) }
end
evaluate() click to toggle source
# File lib/search_cop_grammar.rb, line 16
def evaluate
  elements.collect(&:evaluate).inject(:and)
end
query_info() click to toggle source
# File lib/search_cop_grammar.rb, line 8
def query_info
  (@query_info ||= nil) || parent.query_info
end
query_options() click to toggle source
# File lib/search_cop_grammar.rb, line 12
def query_options
  (@query_options ||= nil) || parent.query_options
end