Sha256: 47818bb77f5d1c6ab518ee89102a9c0a6c44d39f1e7f448bea29bed00637e90b
Contents?: true
Size: 1.61 KB
Versions: 3
Compression:
Stored size: 1.61 KB
Contents
require 'rubygems' gem 'httparty' require 'httparty' dir = File.dirname(__FILE__) require dir + '/songkickr/performance' require dir + '/songkickr/artist' require dir + '/songkickr/location' require dir + '/songkickr/location_result' require dir + '/songkickr/venue' require dir + '/songkickr/event' require dir + '/songkickr/setlist_item' require dir + '/songkickr/setlist' require dir + '/songkickr/event_result' require dir + '/songkickr/concert_setlist_result' require dir + '/songkickr/remote' require dir + '/songkickr/artist_result' class APIKeyNotSet < StandardError; # Warns of missing API key def to_s 'API key not set!' end end class APIError < StandardError; def initialize(message = "API Error") @message = message end def to_s @message end end class ResourceNotFound < APIError; def to_s "Resource not found" end end module Songkickr # Returns the Songkick API key # In order to use the Songkick API, you must have a Songkick API (their rule, not mine). # Get an API key for your app from http://developer.songkick.com/ # # ==== Example # # require 'songkickr' # remote = Songkickr::Remote.new XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # remote.api_key # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX def self.api_key raise APIKeyNotSet if @api_key.nil? @api_key end # Set the API key. In the event you need to set the API key after initializing the the remote. # === Parameters # # * +api_key+ - A developer key from Songkick. Get an API key for your app from http://developer.songkick.com/ def self.api_key=(api_key) @api_key = api_key end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
songkickr-0.3.2 | lib/songkickr.rb |
songkickr-0.3.1 | lib/songkickr.rb |
songkickr-0.3.0 | lib/songkickr.rb |