Class: SongstatsSDK::Client
- Inherits:
-
Object
- Object
- SongstatsSDK::Client
- Defined in:
- lib/songstats_sdk/client.rb
Instance Attribute Summary collapse
-
#artists ⇒ Object
readonly
Returns the value of attribute artists.
-
#collaborators ⇒ Object
readonly
Returns the value of attribute collaborators.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#tracks ⇒ Object
readonly
Returns the value of attribute tracks.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS, max_retries: 2, http_adapter: nil, user_agent: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS, max_retries: 2, http_adapter: nil, user_agent: nil) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/songstats_sdk/client.rb', line 7 def initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS, max_retries: 2, http_adapter: nil, user_agent: nil) @http = HTTPClient.new( api_key: api_key, base_url: base_url, timeout: timeout, max_retries: max_retries, adapter: http_adapter, user_agent: user_agent ) @info = Resources::Info.new(@http) @tracks = Resources::Tracks.new(@http) @artists = Resources::Artists.new(@http) @collaborators = Resources::Collaborators.new(@http) @labels = Resources::Labels.new(@http) end |
Instance Attribute Details
#artists ⇒ Object (readonly)
Returns the value of attribute artists.
5 6 7 |
# File 'lib/songstats_sdk/client.rb', line 5 def artists @artists end |
#collaborators ⇒ Object (readonly)
Returns the value of attribute collaborators.
5 6 7 |
# File 'lib/songstats_sdk/client.rb', line 5 def collaborators @collaborators end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
5 6 7 |
# File 'lib/songstats_sdk/client.rb', line 5 def info @info end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
5 6 7 |
# File 'lib/songstats_sdk/client.rb', line 5 def labels @labels end |
#tracks ⇒ Object (readonly)
Returns the value of attribute tracks.
5 6 7 |
# File 'lib/songstats_sdk/client.rb', line 5 def tracks @tracks end |
Instance Method Details
#close ⇒ Object
25 26 27 |
# File 'lib/songstats_sdk/client.rb', line 25 def close @http.close end |