Class: Leash::Integrations::Caller
- Inherits:
-
Object
- Object
- Leash::Integrations::Caller
- Defined in:
- lib/leash/integrations/base.rb
Overview
Generic escape hatch — call any provider action without a typed wrapper. Returned by ‘leash.integrations.provider(name)`.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#call(action, body: nil) ⇒ Object
Invoke ‘<provider>/<action>` with an optional JSON body.
-
#initialize(transport, name) ⇒ Caller
constructor
A new instance of Caller.
Constructor Details
#initialize(transport, name) ⇒ Caller
Returns a new instance of Caller.
30 31 32 33 |
# File 'lib/leash/integrations/base.rb', line 30 def initialize(transport, name) @transport = transport @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
43 44 45 |
# File 'lib/leash/integrations/base.rb', line 43 def name @name end |
Instance Method Details
#call(action, body: nil) ⇒ Object
Invoke ‘<provider>/<action>` with an optional JSON body.
39 40 41 |
# File 'lib/leash/integrations/base.rb', line 39 def call(action, body: nil) @transport.call(@name, action, body) end |