Class: SearchCop::GrammarParser
- Inherits:
-
Object
- Object
- SearchCop::GrammarParser
- Defined in:
- lib/search_cop/grammar_parser.rb
Instance Attribute Summary collapse
-
#query_info ⇒ Object
readonly
Returns the value of attribute query_info.
Instance Method Summary collapse
-
#initialize(query_info) ⇒ GrammarParser
constructor
A new instance of GrammarParser.
- #parse(string, query_options) ⇒ Object
Constructor Details
#initialize(query_info) ⇒ GrammarParser
Returns a new instance of GrammarParser.
10 11 12 |
# File 'lib/search_cop/grammar_parser.rb', line 10 def initialize(query_info) @query_info = query_info end |
Instance Attribute Details
#query_info ⇒ Object (readonly)
Returns the value of attribute query_info.
8 9 10 |
# File 'lib/search_cop/grammar_parser.rb', line 8 def query_info @query_info end |
Instance Method Details
#parse(string, query_options) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/search_cop/grammar_parser.rb', line 14 def parse(string, ) node = SearchCopGrammarParser.new.parse(string) || raise(ParseError) node.query_info = query_info node. = node.evaluate end |