Sha256: 7ded42189f747f50c9d1a4250cafaf3fb45ee87da272dec378c0ca533dc84e33

Contents?: true

Size: 1.03 KB

Versions: 55

Compression:

Stored size: 1.03 KB

Contents

module SparkApi
  # =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 instanciated separately with the configuration information.
  class Client
    include Connection
    include Authentication
    include Request

    require File.expand_path('../configuration/oauth2_configurable', __FILE__)
    include Configuration::OAuth2Configurable
    
    attr_accessor :authenticator
    attr_accessor *Configuration::VALID_OPTION_KEYS
    
    # Constructor bootstraps the client with configuration and authorization class.
    # options - see Configuration::VALID_OPTION_KEYS
    def initialize(options={})
      options = SparkApi.options.merge(options)
      Configuration::VALID_OPTION_KEYS.each do |key|
        send("#{key}=", options[key])
      end
      # Instanciate the authenication class passed in.
      @authenticator = authentication_mode.send("new", self)
    end
    
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
spark_api-1.4.34 lib/spark_api/client.rb
spark_api-1.4.32 lib/spark_api/client.rb
spark_api-1.4.31 lib/spark_api/client.rb
spark_api-1.4.29 lib/spark_api/client.rb
spark_api-1.4.28 lib/spark_api/client.rb
spark_api-1.4.27 lib/spark_api/client.rb
spark_api-1.4.26 lib/spark_api/client.rb
spark_api-1.4.25 lib/spark_api/client.rb
spark_api-1.4.24 lib/spark_api/client.rb
spark_api-1.4.23 lib/spark_api/client.rb
spark_api-1.4.22 lib/spark_api/client.rb
spark_api-1.4.21 lib/spark_api/client.rb
spark_api-1.4.20 lib/spark_api/client.rb
spark_api-1.4.19 lib/spark_api/client.rb
spark_api-1.4.18 lib/spark_api/client.rb
spark_api-1.4.17 lib/spark_api/client.rb
spark_api-1.4.16 lib/spark_api/client.rb
spark_api-1.4.15 lib/spark_api/client.rb
spark_api-1.4.14 lib/spark_api/client.rb
spark_api-1.4.13 lib/spark_api/client.rb