Class: ESPN::Client
- Inherits:
-
Object
- Object
- ESPN::Client
- Includes:
- Athletes, Audio, Headlines, Medals, Notes, Now, Scores, Sports, Standings, Teams, Video, Connection, Request
- Defined in:
- lib/espn/client.rb,
lib/espn/client/now.rb,
lib/espn/client/audio.rb,
lib/espn/client/notes.rb,
lib/espn/client/teams.rb,
lib/espn/client/video.rb,
lib/espn/client/medals.rb,
lib/espn/client/scores.rb,
lib/espn/client/sports.rb,
lib/espn/client/athletes.rb,
lib/espn/client/headlines.rb,
lib/espn/client/standings.rb
Defined Under Namespace
Modules: Athletes, Audio, Headlines, Medals, Notes, Now, Scores, Sports, Standings, Teams, Video
Instance Method Summary collapse
-
#api_url ⇒ Object
Public: Get the base URL for accessing the ESPN API.
-
#authed? ⇒ Boolean
Public: Determine if the ESPN::Client has been authenticated.
-
#initialize(opts = {}) ⇒ Client
constructor
Public: Initialize a new Client.
Methods included from Video
Methods included from Teams
Methods included from Standings
Methods included from Sports
Methods included from Scores
Methods included from Now
Methods included from Notes
Methods included from Medals
Methods included from Headlines
Methods included from Audio
Methods included from Athletes
Methods included from Request
Constructor Details
#initialize(opts = {}) ⇒ Client
Public: Initialize a new Client. To see all options that can be configured, look at the Configuration module, specifically VALID_OPTIONS_KEYS.
opts - A Hash of configuration options.
28 29 30 31 32 33 |
# File 'lib/espn/client.rb', line 28 def initialize(opts={}) = ESPN..merge(opts) Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end end |
Instance Method Details
#api_url ⇒ Object
Public: Get the base URL for accessing the ESPN API.
Returns a String.
38 39 40 |
# File 'lib/espn/client.rb', line 38 def api_url "http://api.espn.com/v1/" end |
#authed? ⇒ Boolean
Public: Determine if the ESPN::Client has been authenticated. At this point, we are just checking to see if an :api_key has been set.
Returns a Boolean.
46 47 48 |
# File 'lib/espn/client.rb', line 46 def authed? !api_key.nil? end |