Class: Kapnismology::InfoResult

Inherits:
BaseResult show all
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

NullResult, SmokeTest::InfoResult

Instance Attribute Summary

Attributes inherited from BaseResult

#data, #extra_messages, #message

Instance Method Summary collapse

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, message = 'The result could not be determined')
  @passed = true
  @data = data
  @message = message
  @extra_messages = []
end

Instance Method Details

#to_hashObject

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