Class: OpenSandbox::Client
- Inherits:
-
Object
- Object
- OpenSandbox::Client
- Defined in:
- lib/open_sandbox/client.rb
Overview
Main entry point for the OpenSandbox SDK.
Instance Method Summary collapse
-
#healthy? ⇒ Boolean
Health check — returns true if the server responds successfully.
-
#initialize(base_url: nil, api_key: nil, timeout: nil, logger: nil) ⇒ Client
constructor
A new instance of Client.
- #pools ⇒ Pools
- #sandboxes ⇒ Sandboxes
Constructor Details
#initialize(base_url: nil, api_key: nil, timeout: nil, logger: nil) ⇒ Client
Returns a new instance of Client.
79 80 81 82 83 84 85 |
# File 'lib/open_sandbox/client.rb', line 79 def initialize(base_url: nil, api_key: nil, timeout: nil, logger: nil) cfg = OpenSandbox.configuration @base_url = base_url || cfg.base_url @api_key = api_key || cfg.api_key @timeout = timeout || cfg.timeout @logger = logger || cfg.logger end |
Instance Method Details
#healthy? ⇒ Boolean
Health check — returns true if the server responds successfully.
99 100 101 102 103 104 |
# File 'lib/open_sandbox/client.rb', line 99 def healthy? http.get("/health") true rescue Error false end |