class ESPN::Client
Public: The class that handles the bulk of the work between the API and the wrapper.
Examples
client = ESPN::Client.new(api_key: 'abc123') # => ESPN::Client
Attributes
Public: Gets/Sets the Symbol adapter.
Public: Gets/Sets the String api key.
Public: Gets/Sets the Fixnum api version.
Public: Gets/Sets the Fixnum open timeout.
Public: Gets/Sets the String proxy.
Public: Gets/Sets the Fixnum timeout.
Public: Gets/Sets the String user agent.
Public Class Methods
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.
# File lib/espn/client.rb, line 52 def initialize(opts={}) options = ESPN.options.merge(opts) Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", options[key]) end end
Public Instance Methods
Public: Get the base URL for accessing the ESPN
API.
Returns a String.
# File lib/espn/client.rb, line 62 def api_url "http://api.espn.com/v1/" end
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.
# File lib/espn/client.rb, line 70 def authed? !api_key.nil? end