Class: Leash::CustomIntegration
- Inherits:
-
Object
- Object
- Leash::CustomIntegration
- Defined in:
- lib/leash/custom_integration.rb
Overview
Untyped client for a custom integration.
Obtained via Integrations#integration. Proxies requests through the Leash platform at /api/integrations/custom/{name}.
Instance Method Summary collapse
-
#call(path, method: "GET", body: nil, headers: nil) ⇒ Object
Invoke the custom integration proxy.
-
#initialize(name, call_fn) ⇒ CustomIntegration
constructor
A new instance of CustomIntegration.
Constructor Details
#initialize(name, call_fn) ⇒ CustomIntegration
Returns a new instance of CustomIntegration.
15 16 17 18 |
# File 'lib/leash/custom_integration.rb', line 15 def initialize(name, call_fn) @name = name @call_fn = call_fn end |
Instance Method Details
#call(path, method: "GET", body: nil, headers: nil) ⇒ Object
Invoke the custom integration proxy.
28 29 30 |
# File 'lib/leash/custom_integration.rb', line 28 def call(path, method: "GET", body: nil, headers: nil) @call_fn.call(@name, path, method, body, headers) end |