Module: GoogleOAuth::Calendar

Included in:
Client
Defined in:
lib/google_oauth/calendar.rb,
lib/google_oauth/calendar/acl.rb,
lib/google_oauth/calendar/color.rb,
lib/google_oauth/calendar/event.rb,
lib/google_oauth/calendar/setting.rb,
lib/google_oauth/calendar/calendar.rb,
lib/google_oauth/calendar/free_busy.rb,
lib/google_oauth/calendar/calendar_list.rb

Defined Under Namespace

Classes: Acl, Calendar, CalendarList, Color, Event, FreeBusy, Setting

Instance Method Summary collapse

Instance Method Details

#calendar_listObject

Returns entries on the user’s calendar list. CalendarList#list



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/google_oauth/calendar.rb', line 25

def calendar_list
  page_token = nil
  result = execute(:api_method => service.calendar_list.list)
  entries = []
  while true
    entries += result.data.items
    if !(page_token = result.data.next_page_token)
      break
    end
    result = execute(:api_method => service.calendar_list.list,
                            :parameters => {'pageToken' => page_token})
  end

  entries
end

#clear_calendarObject

Clears a primary calendar. This operation deletes all data associated with the primary calendar of an account and cannot be undone.



51
52
# File 'lib/google_oauth/calendar.rb', line 51

def clear_calendar
end

#delete_calendar(calendar_id) ⇒ Object

Deletes a secondary calendar.



55
56
# File 'lib/google_oauth/calendar.rb', line 55

def delete_calendar(calendar_id)
end

#delete_calendar_list(calendar_id) ⇒ Object

Deletes an entry on the user’s calendar list.



12
13
# File 'lib/google_oauth/calendar.rb', line 12

def delete_calendar_list(calendar_id)
end

#events_list(calendar_id = 'primary', options = {}) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/google_oauth/calendar.rb', line 76

def events_list(calendar_id = 'primary', options = {})
  %w(timeMin timeMax).each do |time|
    options[time] = options[time].xmlschema if options[time]
  end

  params = { 'calendarId' => calendar_id }
  params.merge!(options)
  result = execute(:api_method => service.events.list,
                   :parameters => params)
  events = []
  while true
    events += result.data.items
    if !(params[:page_token] = result.data.next_page_token)
      break
    end
    result = execute(:api_method => service.events.list,
                     :parameters => params)
  end

  events
end

#get_calendar(calendar_id = 'primary') ⇒ Object

Returns metadata for a calendar



59
60
61
# File 'lib/google_oauth/calendar.rb', line 59

def get_calendar(calendar_id = 'primary')
  execute(:api_method => service.calendars.get, :parameters => { 'calendarId' => calendar_id }).data
end

#insert_calendar(opts = {}) ⇒ Object

Creates a secondary calendar.



64
65
# File 'lib/google_oauth/calendar.rb', line 64

def insert_calendar(opts = {})
end

#insert_calendar_list(opts = {}) ⇒ Object

Adds an entry to the user’s calendar list.



20
21
# File 'lib/google_oauth/calendar.rb', line 20

def insert_calendar_list(opts = {})
end

#patch_calendar(opts = {}) ⇒ Object

Updates metadata for a calendar. This method supports patch semantics.



72
73
74
# File 'lib/google_oauth/calendar.rb', line 72

def patch_calendar(opts = {})
  update_calendar(opts)
end

#patch_calendar_list(opts = {}) ⇒ Object

Updates an entry on the user’s calendar list. This method supports patch semantics



46
47
48
# File 'lib/google_oauth/calendar.rb', line 46

def patch_calendar_list(opts = {})
  update_calendar_list
end

#update_calendar(opts = {}) ⇒ Object

Updates metadata for a calendar.



68
69
# File 'lib/google_oauth/calendar.rb', line 68

def update_calendar(opts = {})
end

#update_calendar_list(opts = {}) ⇒ Object

Updates an entry on the user’s calendar list.



42
43
# File 'lib/google_oauth/calendar.rb', line 42

def update_calendar_list(opts = {})
end