Class: Spotted::Resources::Playlists::Followers
- Inherits:
-
Object
- Object
- Spotted::Resources::Playlists::Followers
- Defined in:
- lib/spotted/resources/playlists/followers.rb
Instance Method Summary collapse
-
#check(playlist_id, ids: nil, request_options: {}) ⇒ Array<Boolean>
Some parameter documentations has been truncated, see Models::Playlists::FollowerCheckParams for more details.
-
#follow(playlist_id, published: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Playlists::FollowerFollowParams for more details.
-
#initialize(client:) ⇒ Followers
constructor
private
A new instance of Followers.
-
#unfollow(playlist_id, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Playlists::FollowerUnfollowParams for more details.
Constructor Details
#initialize(client:) ⇒ Followers
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Followers.
87 88 89 |
# File 'lib/spotted/resources/playlists/followers.rb', line 87 def initialize(client:) @client = client end |
Instance Method Details
#check(playlist_id, ids: nil, request_options: {}) ⇒ Array<Boolean>
Some parameter documentations has been truncated, see Models::Playlists::FollowerCheckParams for more details.
Check to see if the current user is following a specified playlist.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/spotted/resources/playlists/followers.rb', line 23 def check(playlist_id, params = {}) parsed, = Spotted::Playlists::FollowerCheckParams.dump_request(params) @client.request( method: :get, path: ["playlists/%1$s/followers/contains", playlist_id], query: parsed, model: Spotted::Internal::Type::ArrayOf[Spotted::Internal::Type::Boolean], options: ) end |
#follow(playlist_id, published: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Playlists::FollowerFollowParams for more details.
Add the current user as a follower of a playlist.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/spotted/resources/playlists/followers.rb', line 50 def follow(playlist_id, params = {}) parsed, = Spotted::Playlists::FollowerFollowParams.dump_request(params) @client.request( method: :put, path: ["playlists/%1$s/followers", playlist_id], body: parsed, model: NilClass, options: ) end |
#unfollow(playlist_id, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Playlists::FollowerUnfollowParams for more details.
Remove the current user as a follower of a playlist.
75 76 77 78 79 80 81 82 |
# File 'lib/spotted/resources/playlists/followers.rb', line 75 def unfollow(playlist_id, params = {}) @client.request( method: :delete, path: ["playlists/%1$s/followers", playlist_id], model: NilClass, options: params[:request_options] ) end |