class Zype::Playlists

Read more at docs.zype.com/v1.0/reference#playlists

@since 0.4.0

Public Instance Methods

add_videos(id:, video_ids:) click to toggle source

Adds videos to a playlist

@param id [String] the ID of the playlist @param video_ids [Array<String>] the video IDs to add to the playlist @return [Array<Hash>] an array of video objects

# 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() click to toggle source

Returns all playlists from the API

@return [Array<Hash>] all playlists in relational order

# File lib/zype/models/playlists.rb, line 35
def relationships
  client.execute(method: :get, path: '/playlists/relationships')
end
remove_videos(id:, video_ids:) click to toggle source

Removes videos from a playlist

@param id [String] the ID of the playlist @param video_ids [Array<String>] the video IDs to remove to the playlist @return [Array<Hash>] an array of video objects

# 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:) click to toggle source

Returns videos for a playlist

@param id [String] the ID of the playlist @return [Array<Hash>] an array of video objects

# File lib/zype/models/playlists.rb, line 10
def videos(id:)
  client.execute(method: :get, path: "/playlists/#{id}/videos")
end