class Zype::Base::Playlists

Any playlist nested routes will inherit from this class

Public Instance Methods

all(playlist_id:) click to toggle source

Returns all objects for given class

@param playlist_id [String] the ID of the playlist @return [Array<Hash>] the objects returned from the API

# File lib/zype/models/base/playlists.rb, line 9
def all(playlist_id:)
  client.execute(method: :get, path: "/playlists/#{playlist_id}/#{path}")
end
create(playlist_id:, params:) click to toggle source

Creates a new object via the API.

@param playlist_id [String] ID of the playlist to assign to the object @param params [Hash] the properties of the object @return [Hash] the newly created object

# File lib/zype/models/base/playlists.rb, line 27
def create(playlist_id:, params:)
  client.execute(method: :post, path: "/playlists/#{playlist_id}/#{path}", params: params)
end
delete(playlist_id:, id:) click to toggle source

Deletes an existing object via the API

@param playlist_id [String] the ID of the playlist @param id [String] the ID of the object @return [Hash] the deleted object

# File lib/zype/models/base/playlists.rb, line 45
def delete(playlist_id:, id:)
  client.execute(method: :delete, path: "/playlists/#{playlist_id}/#{path}/#{id}")
end
find(playlist_id:, id:) click to toggle source

Returns object matching ID

@param playlist_id [String] the ID of the playlist @param id [String] the ID of the object @return [Hash] the object returned from the API

# File lib/zype/models/base/playlists.rb, line 18
def find(playlist_id:, id:)
  client.execute(method: :get, path: "/playlists/#{playlist_id}/#{path}/#{id}")
end
update(playlist_id:, id:, params:) click to toggle source

Updates an existing object via the API

@param playlist_id [String] the ID of the playlist @param params [Hash] the properties to be updated @return [Hash] the updated object

# File lib/zype/models/base/playlists.rb, line 36
def update(playlist_id:, id:, params:)
  client.execute(method: :put, path: "/playlists/#{playlist_id}/#{path}/#{id}", params: params)
end