Class: GoogleSimpleApi::Authorizer

Inherits:
Object
  • Object
show all
Defined in:
lib/google_simple_api/authorizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ Authorizer

Returns a new instance of Authorizer.



20
21
22
23
# File 'lib/google_simple_api/authorizer.rb', line 20

def initialize(settings)
    @settings = settings
    @authorization = load_authorization
end

Instance Attribute Details

#authorizationObject (readonly)

Returns the value of attribute authorization.



17
18
19
# File 'lib/google_simple_api/authorizer.rb', line 17

def authorization
  @authorization
end

#settingsObject (readonly)

Returns the value of attribute settings.



18
19
20
# File 'lib/google_simple_api/authorizer.rb', line 18

def settings
  @settings
end

Instance Method Details

#access_token=(access_token) ⇒ Object



33
34
35
# File 'lib/google_simple_api/authorizer.rb', line 33

def access_token=(access_token)
    @authorization.access_token = access_token
end

#callback=(callback) ⇒ Object



25
26
27
# File 'lib/google_simple_api/authorizer.rb', line 25

def callback=(callback)
    @authorization.redirect_uri = callback
end

#code=(code) ⇒ Object



29
30
31
# File 'lib/google_simple_api/authorizer.rb', line 29

def code=(code)
    @authorization.code = code
end

#refresh_token=(refresh_token) ⇒ Object



37
38
39
# File 'lib/google_simple_api/authorizer.rb', line 37

def refresh_token=(refresh_token)
    @authorization.refresh_token = refresh_token
end