class GoogleSimpleApi::Authorizer

Attributes

authorization[R]
settings[R]

Public Class Methods

new(settings) click to toggle source
# File lib/google_simple_api/authorizer.rb, line 20
def initialize(settings)
    @settings = settings
    @authorization = load_authorization
end

Public Instance Methods

access_token=(access_token) click to toggle source
# File lib/google_simple_api/authorizer.rb, line 33
def access_token=(access_token)
    @authorization.access_token = access_token
end
callback=(callback) click to toggle source
# File lib/google_simple_api/authorizer.rb, line 25
def callback=(callback)
    @authorization.redirect_uri = callback
end
code=(code) click to toggle source
# File lib/google_simple_api/authorizer.rb, line 29
def code=(code)
    @authorization.code = code
end
refresh_token=(refresh_token) click to toggle source
# File lib/google_simple_api/authorizer.rb, line 37
def refresh_token=(refresh_token)
    @authorization.refresh_token = refresh_token
end

Private Instance Methods

load_authorization() click to toggle source
# File lib/google_simple_api/authorizer.rb, line 42
def load_authorization
    auth = settings.api_client.authorization
    auth.client_id = settings.client_id
    auth.client_secret = settings.client_secret
    auth.scope = settings.scope.map { |elem| "https://www.googleapis.com/auth/#{elem}" }
    auth
end