Class: Kapnismology::InfoResult
- Inherits:
-
BaseResult
- Object
- BaseResult
- Kapnismology::InfoResult
- Defined in:
- lib/kapnismology/result.rb
Overview
This class can be returned when a check do not want to assert if it passed or not. Instead it can return certain information about the check or the system.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseResult
#data, #extra_messages, #message
Instance Method Summary collapse
-
#initialize(data, message = 'The result could not be determined') ⇒ InfoResult
constructor
A new instance of InfoResult.
-
#to_hash ⇒ Object
Redefining to have our own unique output.
Methods inherited from BaseResult
#add_extra_messages, #passed?, #to_s
Constructor Details
#initialize(data, message = 'The result could not be determined') ⇒ InfoResult
62 63 64 65 66 67 |
# File 'lib/kapnismology/result.rb', line 62 def initialize(data, = 'The result could not be determined') @passed = true @data = data @message = @extra_messages = [] end |
Instance Method Details
#to_hash ⇒ Object
Redefining to have our own unique output
70 71 72 |
# File 'lib/kapnismology/result.rb', line 70 def to_hash { data: @data, message: @message, extra_messages: @extra_messages } end |