Class: Zype::Playlists
- Defined in:
- lib/zype/models/playlists.rb
Overview
Read more at docs.zype.com/v1.0/reference#playlists
Constant Summary
Constants inherited from BaseModel
Instance Attribute Summary
Attributes inherited from BaseModel
Instance Method Summary collapse
-
#add_videos(id:, video_ids:) ⇒ Array<Hash>
Adds videos to a playlist.
-
#relationships ⇒ Array<Hash>
Returns all playlists from the API.
-
#remove_videos(id:, video_ids:) ⇒ Array<Hash>
Removes videos from a playlist.
-
#videos(id:) ⇒ Array<Hash>
Returns videos for a playlist.
Methods inherited from BaseModel
#all, #auth=, #create, #delete, #find, #initialize, #update
Constructor Details
This class inherits a constructor from Zype::BaseModel
Instance Method Details
#add_videos(id:, video_ids:) ⇒ Array<Hash>
Adds videos to a playlist
19 20 21 |
# File 'lib/zype/models/playlists.rb', line 19 def add_videos(id:, video_ids:) client.execute(method: :put, path: "/playlists/#{id}/add_videos", params: { video_id: video_ids }) end |
#relationships ⇒ Array<Hash>
Returns all playlists from the API
35 36 37 |
# File 'lib/zype/models/playlists.rb', line 35 def relationships client.execute(method: :get, path: '/playlists/relationships') end |
#remove_videos(id:, video_ids:) ⇒ Array<Hash>
Removes videos from a playlist
28 29 30 |
# File 'lib/zype/models/playlists.rb', line 28 def remove_videos(id:, video_ids:) client.execute(method: :put, path: "/playlists/#{id}/remove_videos", params: { video_id: video_ids }) end |
#videos(id:) ⇒ Array<Hash>
Returns videos for a playlist
10 11 12 |
# File 'lib/zype/models/playlists.rb', line 10 def videos(id:) client.execute(method: :get, path: "/playlists/#{id}/videos") end |