Class: RegoValidate::ErrorReporter::TextFormatter
- Inherits:
-
Object
- Object
- RegoValidate::ErrorReporter::TextFormatter
- Defined in:
- lib/ruby/rego/cli.rb
Overview
Emits text error output for CLI.
Instance Method Summary collapse
-
#error(message, parser = nil) ⇒ void
-
#initialize(stdout:, stderr:) ⇒ TextFormatter
constructor
A new instance of TextFormatter.
-
#rego_error(error) ⇒ void
Constructor Details
#initialize(stdout:, stderr:) ⇒ TextFormatter
Returns a new instance of TextFormatter.
1066 1067 1068 1069 |
# File 'lib/ruby/rego/cli.rb', line 1066 def initialize(stdout:, stderr:) @stdout = stdout @stderr = stderr end |
Instance Method Details
#error(message, parser = nil) ⇒ void
This method returns an undefined value.
1074 1075 1076 1077 |
# File 'lib/ruby/rego/cli.rb', line 1074 def error(, parser = nil) stderr.puts("Error: #{}") stderr.puts(parser) if parser end |
#rego_error(error) ⇒ void
This method returns an undefined value.
1081 1082 1083 1084 1085 |
# File 'lib/ruby/rego/cli.rb', line 1081 def rego_error(error) location = error.location stderr.puts("Error: #{error.}") stderr.puts(" at #{location}") if location end |