Class: GoogleCalendarApiV2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/google_calendar_api_v2/client.rb

Constant Summary collapse

HEADERS =
{'Content-Type' => 'application/json', 'GData-Version' => '2.6'}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(consumer_key, consumer_secret, token, token_secret) ⇒ Client

Initialize this class with :consumer_key, :consumer_secret, :token, :token_secret



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

def initialize(consumer_key, consumer_secret, token, token_secret)
  consumer = OAuth::Consumer.new(consumer_key, consumer_secret, {
    :site               => "https://www.google.com",
    :scheme             => :header
  })

  @connection = OAuth::AccessToken.new(consumer,token, token_secret)

  @calendars = Calendar.new(@connection)
end

Instance Attribute Details

#calendarsObject (readonly)

Returns the value of attribute calendars.



5
6
7
# File 'lib/google_calendar_api_v2/client.rb', line 5

def calendars
  @calendars
end

#connectionObject (readonly)

Returns the value of attribute connection.



5
6
7
# File 'lib/google_calendar_api_v2/client.rb', line 5

def connection
  @connection
end

#eventsObject (readonly)

Returns the value of attribute events.



5
6
7
# File 'lib/google_calendar_api_v2/client.rb', line 5

def events
  @events
end

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/google_calendar_api_v2/client.rb', line 5

def headers
  @headers
end