Class: Songkick::Client

Inherits:
Object
  • Object
show all
Includes:
Calendar, Event, Request, Search, User
Defined in:
lib/songkick/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from User

#attendance, #gigography, #muted_artists, #track_artist, #track_location, #tracked_artists, #tracked_locations

Methods included from Search

#search_artists, #search_events, #search_locations, #search_venues

Methods included from Validations

#validate_options

Methods included from Event

#event_set_lists, #find_event

Methods included from Calendar

#artist_calendar, #location_calendar, #user_calendar, #venue_calendar

Constructor Details

#initialize(api_key, format = :json) ⇒ Client

Look at the songkick.rb file for info Songkick::Client.new == Songkick.new



14
15
16
17
# File 'lib/songkick/client.rb', line 14

def initialize(api_key, format = :json)
  @api_key = api_key
  @format = format.to_s
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



10
11
12
# File 'lib/songkick/client.rb', line 10

def api_key
  @api_key
end

#formatObject

Returns the value of attribute format.



10
11
12
# File 'lib/songkick/client.rb', line 10

def format
  @format
end

Instance Method Details

#json?Boolean

Clean way to know if the format is in json

Returns:

  • (Boolean)


20
21
22
# File 'lib/songkick/client.rb', line 20

def json?
  format == 'json'
end

#xml?Boolean

Clean way to know if the format is in xml

Returns:

  • (Boolean)


25
26
27
# File 'lib/songkick/client.rb', line 25

def xml?
  format == 'xml'
end