Class: HttpHealthCheck::Probe::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/http_health_check/probe/result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(is_ok, meta) ⇒ Result

Returns a new instance of Result.



14
15
16
17
18
19
20
21
# File 'lib/http_health_check/probe/result.rb', line 14

def initialize(is_ok, meta)
  @meta = Hash(meta)
  @ok = is_ok
rescue StandardError => e
  e = ::HttpHealthCheck::ConfigurationError.new(e.message)
  e.set_backtrace(e.backtrace)
  raise e
end

Instance Attribute Details

#metaObject (readonly)

Returns the value of attribute meta.



22
23
24
# File 'lib/http_health_check/probe/result.rb', line 22

def meta
  @meta
end

Class Method Details

.error(meta) ⇒ Object



10
11
12
# File 'lib/http_health_check/probe/result.rb', line 10

def self.error(meta)
  new(false, meta)
end

.ok(meta) ⇒ Object



6
7
8
# File 'lib/http_health_check/probe/result.rb', line 6

def self.ok(meta)
  new(true, meta)
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/http_health_check/probe/result.rb', line 24

def ok?
  @ok
end