Class: GoogleCalendar::Client

Inherits:
Object
  • Object
show all
Extended by:
Connection
Defined in:
lib/google_calendar_oauth2/client.rb

Instance Method Summary collapse

Methods included from Connection

client, connection

Constructor Details

#initialize(client_id, client_secret, redirect_uri) ⇒ Client

Returns a new instance of Client.



17
18
19
20
21
22
23
# File 'lib/google_calendar_oauth2/client.rb', line 17

def initialize(client_id, client_secret, redirect_uri)
  GoogleCalendar.connection = Google::APIClient.new
  GoogleCalendar.connection.authorization.client_id = client_id 
  GoogleCalendar.connection.authorization.client_secret = client_secret 
  GoogleCalendar.connection.authorization.scope = 'https://www.googleapis.com/auth/calendar'
  GoogleCalendar.connection.authorization.redirect_uri = redirect_uri
end

Instance Method Details

#redirect_toObject



25
26
27
# File 'lib/google_calendar_oauth2/client.rb', line 25

def redirect_to
  GoogleCalendar.connection.authorization.authorization_uri.to_s
end