Class: Spotify::API::User
Constant Summary collapse
- USERS_URL =
API endpoint for users.
"#{BASE_URL}users"
Constants inherited from Base
Base::BASE_URL, Base::FROM_TOKEN, Base::MAX_RETRIES, Base::SEARCH_URL
Instance Attribute Summary
Attributes inherited from Base
#params, #request, #response, #retries, #timeout, #url
Class Method Summary collapse
-
.search_by_id(args = {}) ⇒ Public::User
Gets an user.
Instance Method Summary collapse
-
#body ⇒ Hash
Parses the response to JSON to get more flexible.
-
#search_by_id(args = {}) ⇒ Public::User
Gets a track.
Methods inherited from Base
#define_response, #get, #initialize, #make_request, #prepare_request, #run_with_timeout, #set_response
Constructor Details
This class inherits a constructor from Spotify::API::Base
Class Method Details
.search_by_id(args = {}) ⇒ Public::User
Gets an user.
20 21 22 23 24 25 |
# File 'lib/spotify/api/user.rb', line 20 def self.search_by_id(args = {}) service_params = args.slice(:timeout, :retries) args = args.slice(:id) self.new(service_params).search_by_id(args) end |
Instance Method Details
#body ⇒ Hash
Parses the response to JSON to get more flexible.
49 50 51 52 53 |
# File 'lib/spotify/api/user.rb', line 49 def body @response = JSON.parse(response) rescue Spotify::Models::Error.parser_error end |