Sha256: 30c6620c8a0eeaab77efd7516cf0e57b267c1ab0e371be99b393cefe6245fbe1

Contents?: true

Size: 1005 Bytes

Versions: 1

Compression:

Stored size: 1005 Bytes

Contents

require_relative 'request'
require_relative 'music/requests'
require_relative 'music/results'
require_relative 'music/album'
require_relative 'music/artist'
require_relative 'music/song'

module ItunesApi
  # Public interface for the Music Api
  module Music
    class << self
      def all_apple_ids(name, store = default_store)
        Artist.all_apple_ids(name, store)
      end

      def all_artists_by_name(name, store = default_store)
        Artist.find_all_by_name(name, store)
      end

      def find_by_apple_id(apple_id, store = default_store)
        Music::Artist.find_by_apple_id(apple_id, store)
      end

      def albums_for_artist(apple_id, store = default_store)
        Music::Album.for_artist(apple_id, store)
      end

      def find_by_collection_id(collection_id, store)
        Music::Album.find_by_collection_id(collection_id, store)
      end

      private

      def default_store
        ItunesApi::Configuration.instance.country_code || :gb
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
itunes_api-2.1.0 lib/itunes_api/music.rb