Class: GoogleOAuth::Client

Inherits:
Object
  • Object
show all
Includes:
Calendar
Defined in:
lib/google_oauth/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Calendar

#calendar_list, #clear_calendar, #delete_calendar, #delete_calendar_list, #events_list, #get_calendar, #insert_calendar, #insert_calendar_list, #patch_calendar, #patch_calendar_list, #update_calendar, #update_calendar_list

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
17
18
# File 'lib/google_oauth/client.rb', line 10

def initialize(options = {})
  [:refresh_token, :access_token, :expires_at].each do |attr|
    instance_variable_set("@#{attr}".to_sym, options[:authentication].send(attr))
  end

  @authentication = options[:authentication]

  setup_google_client!
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

Delegate to Google OAuth Client



21
22
23
# File 'lib/google_oauth/client.rb', line 21

def method_missing(method, *args, &block)
  google_client.send(method, *args, &block)
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



8
9
10
# File 'lib/google_oauth/client.rb', line 8

def access_token
  @access_token
end

#authenticationObject

Returns the value of attribute authentication.



8
9
10
# File 'lib/google_oauth/client.rb', line 8

def authentication
  @authentication
end

#expires_atObject

Returns the value of attribute expires_at.



8
9
10
# File 'lib/google_oauth/client.rb', line 8

def expires_at
  @expires_at
end

#google_clientObject

Returns the value of attribute google_client.



8
9
10
# File 'lib/google_oauth/client.rb', line 8

def google_client
  @google_client
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



8
9
10
# File 'lib/google_oauth/client.rb', line 8

def refresh_token
  @refresh_token
end