class Napster::Models::Content

Contet model This model is used for

Attributes

client[RW]

Public Class Methods

collection(arg) click to toggle source
# File lib/napster/models/content.rb, line 10
def self.collection(arg)
  arg[:data].map do |content|
    case content['type']
    when 'album'
      Album.new(data: content, client: @client)
    when 'artist'
      Artist.new(data: content, client: @client)
    when 'genre'
      Genre.new(data: content, client: @client)
    when 'playlist'
      Playlist.new(data: content, client: @client)
    when 'track'
      Track.new(data: content, client: @client)
    end
  end
end