Sha256: 27909a35c6ddaf2dee30f101a8311f80ba86499f976e0259ae49bee058f933be

Contents?: true

Size: 479 Bytes

Versions: 1

Compression:

Stored size: 479 Bytes

Contents

module LazyGoogleAnalytics
  class Auth

    attr_accessor :analytics, :client

    def initialize(config)
      @key = Google::APIClient::PKCS12.load_key(config.key_file, config.pass_phrase)
      @asserter = Google::APIClient::JWTAsserter.new( config.email, config.scope, @key)
    end

    def authorize
      @client = Google::APIClient.new()
      @client.authorization = @asserter.authorize()
      @analytics = @client.discovered_api("analytics",'v3')
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lazy_google_analytics-0.0.1 lib/lazy_google_analytics/auth.rb