Class: Inspec::Reporters::Base
- Inherits:
-
Object
- Object
- Inspec::Reporters::Base
- Defined in:
- lib/inspec/reporters/base.rb
Instance Attribute Summary collapse
-
#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) ⇒ Object
-
#render ⇒ Object
each reporter must implement #render.
- #rendered_output ⇒ Object
Constructor Details
#initialize(config) ⇒ Base
Returns a new instance of Base.
5 6 7 8 |
# File 'lib/inspec/reporters/base.rb', line 5 def initialize(config) @run_data = config[:run_data] @output = '' end |
Instance Attribute Details
#run_data ⇒ Object (readonly)
Returns the value of attribute run_data.
3 4 5 |
# File 'lib/inspec/reporters/base.rb', line 3 def run_data @run_data end |
Instance Method Details
#output(str) ⇒ Object
10 11 12 |
# File 'lib/inspec/reporters/base.rb', line 10 def output(str) @output << "#{str}\n" end |
#render ⇒ Object
each reporter must implement #render
19 20 21 |
# File 'lib/inspec/reporters/base.rb', line 19 def render raise NotImplementedError, "#{self.class} must implement a `#render` method to format its output." end |
#rendered_output ⇒ Object
14 15 16 |
# File 'lib/inspec/reporters/base.rb', line 14 def rendered_output @output end |