Class: ESPN::Client

Inherits:
Object
  • Object
show all
Includes:
Sports, Teams, Connection, Request
Defined in:
lib/espn/client.rb,
lib/espn/client/teams.rb,
lib/espn/client/sports.rb

Defined Under Namespace

Modules: Sports, Teams

Instance Method Summary collapse

Methods included from Teams

#teams

Methods included from Sports

#sports

Methods included from Request

#get

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
# File 'lib/espn/client.rb', line 11

def initialize(options={})
  options = ESPN.options.merge(options)
  Configuration::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", options[key])
  end
end

Instance Method Details

#api_urlString

Provides the URL for accessing the API

Returns:

  • (String)


21
22
23
# File 'lib/espn/client.rb', line 21

def api_url
  "http://api.espn.com/v1"
end

#authed?Boolean

Determine if an api_key has been set

Returns:

  • (Boolean)


28
29
30
# File 'lib/espn/client.rb', line 28

def authed?
  !api_key.nil?
end