Class: AISpec::Core::Reporters::Base
- Inherits:
-
Object
- Object
- AISpec::Core::Reporters::Base
- Defined in:
- lib/aispec/core/reporters/base.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Attribute Summary collapse
-
#output_io ⇒ Object
readonly
Returns the value of attribute output_io.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(results, output_io: $stdout) ⇒ Base
constructor
A new instance of Base.
- #render ⇒ Object
Constructor Details
#initialize(results, output_io: $stdout) ⇒ Base
Returns a new instance of Base.
23 24 25 26 |
# File 'lib/aispec/core/reporters/base.rb', line 23 def initialize(results, output_io: $stdout) @results = results @output_io = output_io end |
Class Attribute Details
.registry ⇒ Object (readonly)
Returns the value of attribute registry.
10 11 12 |
# File 'lib/aispec/core/reporters/base.rb', line 10 def registry @registry end |
Instance Attribute Details
#output_io ⇒ Object (readonly)
Returns the value of attribute output_io.
21 22 23 |
# File 'lib/aispec/core/reporters/base.rb', line 21 def output_io @output_io end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
21 22 23 |
# File 'lib/aispec/core/reporters/base.rb', line 21 def results @results end |
Class Method Details
.get(name) ⇒ Object
16 17 18 |
# File 'lib/aispec/core/reporters/base.rb', line 16 def get(name) @registry[name.to_s.downcase] || Console end |
.register(name, reporter_class) ⇒ Object
12 13 14 |
# File 'lib/aispec/core/reporters/base.rb', line 12 def register(name, reporter_class) @registry[name.to_s.downcase] = reporter_class end |
Instance Method Details
#render ⇒ Object
28 29 30 |
# File 'lib/aispec/core/reporters/base.rb', line 28 def render raise NotImplementedError, "#{self.class.name} must implement #render" end |