Class: Teamlab::Calendar

Inherits:
Object
  • Object
show all
Defined in:
lib/teamlab/modules/calendar.rb

Instance Method Summary collapse

Constructor Details

#initializeCalendar

Returns a new instance of Calendar.



3
4
5
# File 'lib/teamlab/modules/calendar.rb', line 3

def initialize
  @request = Teamlab::Request.new('calendar')
end

Instance Method Details

#add_event(calendar_id, name, options = {}) ⇒ Object

TODO: OPTIONAL VARIABLES


49
50
51
# File 'lib/teamlab/modules/calendar.rb', line 49

def add_event(calendar_id, name, options = {})
  @request.post([calendar_id.to_s, 'event'], { name: name }.merge(options))
end

#create_calendar(name, time_zone, options = {}) ⇒ Object



39
40
41
# File 'lib/teamlab/modules/calendar.rb', line 39

def create_calendar(name, time_zone, options = {})
  @request.post('', { name: name, timeZone: time_zone }.merge(options))
end


43
44
45
# File 'lib/teamlab/modules/calendar.rb', line 43

def create_calendar_by_ical_link(ical_url, name, options = {})
  @request.post(%w(calendarurl), { iCalUrl: ical_url, name: name }.merge(options))
end

#delete_calendar(calendar_id) ⇒ Object



79
80
81
# File 'lib/teamlab/modules/calendar.rb', line 79

def delete_calendar(calendar_id)
  @request.delete([calendar_id.to_s])
end

#delete_event_series(event_id) ⇒ Object



83
84
85
# File 'lib/teamlab/modules/calendar.rb', line 83

def delete_event_series(event_id)
  @request.delete(['events', event_id.to_s])
end

#get_access_parameters(calendar_id) ⇒ Object



23
24
25
# File 'lib/teamlab/modules/calendar.rb', line 23

def get_access_parameters(calendar_id)
  @request.get([calendar_id.to_s, 'sharing'])
end

#get_calendar(id) ⇒ Object



11
12
13
# File 'lib/teamlab/modules/calendar.rb', line 11

def get_calendar(id)
  @request.get([id.to_s])
end

#get_calendar_events(start_date, end_date) ⇒ Object



31
32
33
# File 'lib/teamlab/modules/calendar.rb', line 31

def get_calendar_events(start_date, end_date)
  @request.get(['eventdays', start_date.to_s, end_date.to_s])
end

#get_calendars_and_subscriptions(start_date, end_date) ⇒ Object



35
36
37
# File 'lib/teamlab/modules/calendar.rb', line 35

def get_calendars_and_subscriptions(start_date, end_date)
  @request.get(['calendars', start_date.to_s, end_date.to_s])
end

#get_default_accessObject



7
8
9
# File 'lib/teamlab/modules/calendar.rb', line 7

def get_default_access
  @request.get(%w(sharing))
end

#get_icalc_feed(calendar_id, signature) ⇒ Object



27
28
29
# File 'lib/teamlab/modules/calendar.rb', line 27

def get_icalc_feed(calendar_id, signature)
  @request.get([calendar_id.to_s, 'ical', signature.to_s])
end


19
20
21
# File 'lib/teamlab/modules/calendar.rb', line 19

def get_icalc_link(calendar_id)
  @request.get([calendar_id.to_s, 'icalurl'])
end

#get_subscription_listObject



15
16
17
# File 'lib/teamlab/modules/calendar.rb', line 15

def get_subscription_list
  @request.get(%w(subscriptions))
end

#import_ical(calendar_id, file) ⇒ Object



53
54
55
# File 'lib/teamlab/modules/calendar.rb', line 53

def import_ical(calendar_id, file)
  @request.post([calendar_id.to_s, 'import'], somefile: File.new(file))
end

#manage_subscriptions(states) ⇒ Object



69
70
71
# File 'lib/teamlab/modules/calendar.rb', line 69

def manage_subscriptions(states)
  @request.put(%w(subscriptions manage), states: states)
end

#remove_event(event_id, options = {}) ⇒ Object

TODO: OPTIONAL VARIABLES


89
90
91
# File 'lib/teamlab/modules/calendar.rb', line 89

def remove_event(event_id, options = {})
  @request.delete(['events', event_id.to_s, 'custom'], options)
end

#unsubscribe_from_event(event_id) ⇒ Object



93
94
95
# File 'lib/teamlab/modules/calendar.rb', line 93

def unsubscribe_from_event(event_id)
  @request.delete(['events', event_id.to_s, 'unsubscribe'])
end

#update_calendar(calendar_id, name, time_zone, options = {}) ⇒ Object

TODO: OPTIONAL VARIABLES


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

def update_calendar(calendar_id, name, time_zone, options = {})
  @request.put([calendar_id.to_s], { name: name, timeZone: time_zone }.merge(options))
end

#update_calendar_user_view(calendar_id, name, time_zone, options = {}) ⇒ Object

TODO: OPTIONAL VARIABLES


65
66
67
# File 'lib/teamlab/modules/calendar.rb', line 65

def update_calendar_user_view(calendar_id, name, time_zone, options = {})
  @request.put([calendar_id.to_s, 'view'], { name: name, timeZone: time_zone }.merge(options))
end

#update_event(calendar_id, event_id, name, options = {}) ⇒ Object

TODO: OPTIONAL VARIABLES


75
76
77
# File 'lib/teamlab/modules/calendar.rb', line 75

def update_event(calendar_id, event_id, name, options = {})
  @request.put([calendar_id.to_s, event_id.to_s], { name: name }.merge(options))
end