Class: Songstats::Api::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/songstats/api/base.rb

Overview

Base class for the Songstats API

Direct Known Subclasses

Artist, Chart, Label, Track

Constant Summary collapse

SONG_STATS_ID_LENGTH =
8
ISRC_LENGTH =
12

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



16
17
18
19
20
# File 'lib/songstats/api/base.rb', line 16

def initialize
  @api_key = ENV.fetch "SONGSTATS_API_KEY", nil

  raise Songstats::Api::Error, "Missing SongStats API key" if @api_key.nil?
end