Exception: HealthBit::CheckError
- Inherits:
-
StandardError
- Object
- StandardError
- HealthBit::CheckError
- Defined in:
- lib/health_bit/check_error.rb
Constant Summary collapse
- FORMAT_FULL =
:full
- FORMAT_SHORT =
nil
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, exception: nil) ⇒ CheckError
constructor
A new instance of CheckError.
- #to_s(format = nil) ⇒ String
Constructor Details
#initialize(name, exception: nil) ⇒ CheckError
Returns a new instance of CheckError.
10 11 12 13 |
# File 'lib/health_bit/check_error.rb', line 10 def initialize(name, exception: nil) @name = name @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
8 9 10 |
# File 'lib/health_bit/check_error.rb', line 8 def exception @exception end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/health_bit/check_error.rb', line 8 def name @name end |
Instance Method Details
#to_s(format = nil) ⇒ String
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/health_bit/check_error.rb', line 16 def to_s(format = nil) io = StringIO.new io.puts "Check <#{name}> failed" case format when FORMAT_FULL describe_exception(io) end io.string.chomp end |