class SparkApi::Client

API Client

Main class to setup and run requests on the API. A default client is accessible globally as SparkApi::client if the global configuration has been set as well. Otherwise, this class may be instantiated separately with the configuration information.

Attributes

authenticator[RW]

Public Class Methods

new(options={}) click to toggle source

Constructor bootstraps the client with configuration and authorization class. options - see Configuration::VALID_OPTION_KEYS

# File lib/spark_api/client.rb, line 19
def initialize(options={})
  options = SparkApi.options.merge(options)
  Configuration::VALID_OPTION_KEYS.each do |key|
    send("#{key}=", options[key])
  end
  # Instantiate the authentication class passed in.
  @authenticator = authentication_mode.send("new", self)
end