Class: Inspec::Reporters::Base
- Inherits:
-
Object
- Object
- Inspec::Reporters::Base
- Includes:
- Utils::RunDataFilters
- Defined in:
- lib/inspec/reporters/base.rb
Instance Attribute Summary collapse
-
#enhanced_outcomes ⇒ Object
Returns the value of attribute enhanced_outcomes.
-
#run_data ⇒ Object
readonly
Returns the value of attribute run_data.
Instance Method Summary collapse
-
#initialize(config) ⇒ Base
constructor
A new instance of Base.
- #output(str, newline = true) ⇒ Object
-
#render ⇒ Object
each reporter must implement #render.
- #rendered_output ⇒ Object
Methods included from Utils::RunDataFilters
#apply_report_resize_options, #apply_run_data_filters_to_hash, #filter_empty_profiles, #redact_sensitive_inputs, #sort_controls, #suppress_diff_output
Constructor Details
#initialize(config) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 15 16 |
# File 'lib/inspec/reporters/base.rb', line 10 def initialize(config) @config = config @run_data = config[:run_data] || {} apply_run_data_filters_to_hash @output = "" end |
Instance Attribute Details
#enhanced_outcomes ⇒ Object
Returns the value of attribute enhanced_outcomes.
8 9 10 |
# File 'lib/inspec/reporters/base.rb', line 8 def enhanced_outcomes @enhanced_outcomes end |
#run_data ⇒ Object (readonly)
Returns the value of attribute run_data.
7 8 9 |
# File 'lib/inspec/reporters/base.rb', line 7 def run_data @run_data end |
Instance Method Details
#output(str, newline = true) ⇒ Object
18 19 20 21 |
# File 'lib/inspec/reporters/base.rb', line 18 def output(str, newline = true) @output << str @output << "\n" if newline end |
#render ⇒ Object
each reporter must implement #render
28 29 30 |
# File 'lib/inspec/reporters/base.rb', line 28 def render raise NotImplementedError, "#{self.class} must implement a `#render` method to format its output." end |
#rendered_output ⇒ Object
23 24 25 |
# File 'lib/inspec/reporters/base.rb', line 23 def rendered_output @output end |