Class: HealtcheckProxyClient::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/healtcheck_proxy_client/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration:, healthcheck:) ⇒ Client

Returns a new instance of Client.



7
8
9
10
# File 'lib/healtcheck_proxy_client/client.rb', line 7

def initialize(configuration:, healthcheck:)
  @configuration = configuration
  @healthcheck   = healthcheck
end

Class Method Details

.ping(configuration:, healthcheck:) ⇒ Object



12
13
14
# File 'lib/healtcheck_proxy_client/client.rb', line 12

def self.ping(configuration:, healthcheck:)
  new(configuration: configuration, healthcheck: healthcheck).ping
end

Instance Method Details

#pingObject



16
17
18
19
20
# File 'lib/healtcheck_proxy_client/client.rb', line 16

def ping
  Faraday.get(url)
rescue Faraday::Error => e
  raise HttpError.new(e.message, http_error: e)
end