Class: Musixmatch

Inherits:
Object
  • Object
show all
Includes:
APIMethod, Request, Version
Defined in:
lib/musixmatch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from APIMethod

#album_get, #album_tracks_get, #artist_albums_get, #artist_get, #artist_related_get, #artist_search, #catalogue_dump_get, #chart_artists_get, #chart_tracks_get, #matcher_lyrics_get, #matcher_subtitle_get, #matcher_track_get, #music_genres_get, #track_get, #track_lyrics_get, #track_lyrics_translation_get, #track_richsync_get, #track_search, #track_snippet_get, #track_subtitle_get, #track_subtitle_translation_get, #tracking_url_get

Methods included from Request

base_url, #http

Methods included from Version

api_version, version

Constructor Details

#initialize(api_key = ENV['MUSIXMATCH_API_KEY']) ⇒ Musixmatch

Returns a new instance of Musixmatch.



13
14
15
16
17
18
19
20
# File 'lib/musixmatch.rb', line 13

def initialize(api_key = ENV['MUSIXMATCH_API_KEY'])
  raise 'API key is required' unless api_key

  @version = Version.version
  @api_version = Version.api_version
  @api_key = api_key
  @url = Request.base_url
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



11
12
13
# File 'lib/musixmatch.rb', line 11

def api_key
  @api_key
end

#api_versionObject

Returns the value of attribute api_version.



11
12
13
# File 'lib/musixmatch.rb', line 11

def api_version
  @api_version
end

#urlObject

Returns the value of attribute url.



11
12
13
# File 'lib/musixmatch.rb', line 11

def url
  @url
end

#versionObject

Returns the value of attribute version.



11
12
13
# File 'lib/musixmatch.rb', line 11

def version
  @version
end