Class: PlatformSdk::Bynder::Client
- Inherits:
-
Object
- Object
- PlatformSdk::Bynder::Client
- Defined in:
- lib/platform_sdk/bynder/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
Instance Method Summary collapse
- #asset(asset_id) ⇒ Object
- #assets(query_params = {}) ⇒ Object
-
#initialize(base_url, access_token, conn: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(base_url, access_token, conn: nil) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 |
# File 'lib/platform_sdk/bynder/client.rb', line 8 def initialize(base_url, access_token, conn: nil) @access_token = access_token @base_url = base_url @conn = conn || build_connection end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/platform_sdk/bynder/client.rb', line 6 def access_token @access_token end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
6 7 8 |
# File 'lib/platform_sdk/bynder/client.rb', line 6 def base_url @base_url end |
#conn ⇒ Object (readonly)
Returns the value of attribute conn.
6 7 8 |
# File 'lib/platform_sdk/bynder/client.rb', line 6 def conn @conn end |
Instance Method Details
#asset(asset_id) ⇒ Object
20 21 22 23 24 |
# File 'lib/platform_sdk/bynder/client.rb', line 20 def asset(asset_id) resource_path = "/api/v4/media" response = get(resource_path, { id: asset_id }) response.body end |
#assets(query_params = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/platform_sdk/bynder/client.rb', line 14 def assets(query_params = {}) resource_path = "/api/v4/media" response = get(resource_path, query_params) response.body end |