Class: PgVerify::EbnfParser::ParserResult
- Inherits:
-
Object
- Object
- PgVerify::EbnfParser::ParserResult
- Defined in:
- lib/pg-verify/ebnf_parser/parser_result.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
Returns the value of attribute ast.
-
#error ⇒ Object
Returns the value of attribute error.
Instance Method Summary collapse
- #check! ⇒ Object
- #error? ⇒ Boolean
-
#initialize(ast, error) ⇒ ParserResult
constructor
A new instance of ParserResult.
Constructor Details
#initialize(ast, error) ⇒ ParserResult
Returns a new instance of ParserResult.
9 10 11 |
# File 'lib/pg-verify/ebnf_parser/parser_result.rb', line 9 def initialize(ast, error) @ast, @error = ast, error end |
Instance Attribute Details
#ast ⇒ Object
Returns the value of attribute ast.
6 7 8 |
# File 'lib/pg-verify/ebnf_parser/parser_result.rb', line 6 def ast @ast end |
#error ⇒ Object
Returns the value of attribute error.
7 8 9 |
# File 'lib/pg-verify/ebnf_parser/parser_result.rb', line 7 def error @error end |
Instance Method Details
#check! ⇒ Object
13 14 15 16 17 |
# File 'lib/pg-verify/ebnf_parser/parser_result.rb', line 13 def check!() return unless error?() # TODO: Custom exception raise @error end |
#error? ⇒ Boolean
19 20 21 |
# File 'lib/pg-verify/ebnf_parser/parser_result.rb', line 19 def error?() return !@error.nil? end |