Class: BundleUp::Client
- Inherits:
-
Object
- Object
- BundleUp::Client
- Defined in:
- lib/bundleup/client.rb
Overview
Client for core BundleUp API resources.
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #connections ⇒ Object
-
#initialize(api_key) ⇒ Client
constructor
A new instance of Client.
- #integrations ⇒ Object
- #proxy(connection_id) ⇒ Object
- #unify(connection_id) ⇒ Object
- #webhooks ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 |
# File 'lib/bundleup/client.rb', line 8 def initialize(api_key) raise ArgumentError, 'API key is required to initialize BundleUp SDK.' if api_key.nil? || api_key.empty? @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/bundleup/client.rb', line 6 def api_key @api_key end |
Instance Method Details
#connections ⇒ Object
14 15 16 |
# File 'lib/bundleup/client.rb', line 14 def connections @connections ||= BundleUp::Resources::Connection.new(@api_key) end |
#integrations ⇒ Object
18 19 20 |
# File 'lib/bundleup/client.rb', line 18 def integrations @integrations ||= BundleUp::Resources::Integration.new(@api_key) end |
#proxy(connection_id) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/bundleup/client.rb', line 26 def proxy(connection_id) if connection_id.nil? || connection_id.empty? raise ArgumentError, 'Connection ID is required to create a Proxy instance.' end BundleUp::Proxy.new(@api_key, connection_id) end |
#unify(connection_id) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/bundleup/client.rb', line 34 def unify(connection_id) if connection_id.nil? || connection_id.empty? raise ArgumentError, 'Connection ID is required to create a Unify instance.' end BundleUp::Unify::Client.new(@api_key, connection_id) end |