Sha256: c404d5d0267e1a545501dcb87fa72639032a1e881acdf0c9a4993a58eeeae757

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

module ItunesApi
  module Music
    module Requests
      # Allows querying the API via lookup for albums.
      class Albums
        include Request
        attr_reader_init :search_id, :store
        selfie :find_by_id

        def find_by_id
          unwrapped_results(:collection).map do |result|
            Results::Album.new(result, store)
          end
        end

        private

        def action
          'lookup'
        end

        def query
          {
            country: store.to_s.upcase,
            entity: :album,
            id: search_id,
            limit: LIMIT
          }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
itunes_api-2.4.1 lib/itunes_api/music/requests/albums.rb
itunes_api-2.4.0 lib/itunes_api/music/requests/albums.rb
itunes_api-2.3.2 lib/itunes_api/music/requests/albums.rb