Sha256: 4b73a78920a6c672f87634341c34b0608b74945c192a7205995462eaab754bf9

Contents?: true

Size: 553 Bytes

Versions: 2

Compression:

Stored size: 553 Bytes

Contents

module RSpotify

  class Album < Base

    attr_accessor :album_type, :images, :name, :tracks

    def self.find(id)
      super(id, 'album')
    end

    def self.search(query, limit = 20, offset = 0)
      super(query, 'album', limit, offset)
    end

    def initialize(options = {})
      @album_type = options['album_type']
      @images     = options['images']
      @name       = options['name']

      if options['tracks']
        @tracks = options['tracks']['items'].map { |t| Track.new (t) }
      end

      super(options)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspotify-0.1.0 lib/rspotify/album.rb
rspotify-0.1.1 lib/rspotify/album.rb