Class: RegoValidate::ParseResult
- Inherits:
-
Struct
- Object
- Struct
- RegoValidate::ParseResult
- Defined in:
- lib/ruby/rego/cli.rb,
lib/ruby/rego/cli.rb
Overview
Parsed options plus parser state and error details.
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#options ⇒ Object
Returns the value of attribute options.
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
-
#report_error(stdout:, stderr:) ⇒ void
Report the parse error using the configured output format.
-
#success? ⇒ Boolean
Check whether parsing succeeded.
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error
31 32 33 |
# File 'lib/ruby/rego/cli.rb', line 31 def error @error end |
#options ⇒ Object
Returns the value of attribute options
31 32 33 |
# File 'lib/ruby/rego/cli.rb', line 31 def @options end |
#parser ⇒ Object
Returns the value of attribute parser
31 32 33 |
# File 'lib/ruby/rego/cli.rb', line 31 def parser @parser end |
Instance Method Details
#report_error(stdout:, stderr:) ⇒ void
This method returns an undefined value.
Report the parse error using the configured output format.
47 48 49 50 |
# File 'lib/ruby/rego/cli.rb', line 47 def report_error(stdout:, stderr:) reporter = ErrorReporter.new(stdout: stdout, stderr: stderr, format: .format) reporter.error(, parser) end |
#success? ⇒ Boolean
Check whether parsing succeeded.
38 39 40 |
# File 'lib/ruby/rego/cli.rb', line 38 def success? !error end |