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.



4
5
6
# File 'lib/teamlab/Modules/Calendar.rb', line 4

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

Instance Method Details

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

TODO: OPTIONAL VARIABLES


50
51
52
# File 'lib/teamlab/Modules/Calendar.rb', line 50

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



40
41
42
# File 'lib/teamlab/Modules/Calendar.rb', line 40

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


44
45
46
# File 'lib/teamlab/Modules/Calendar.rb', line 44

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



80
81
82
# File 'lib/teamlab/Modules/Calendar.rb', line 80

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

#delete_event_series(event_id) ⇒ Object



84
85
86
# File 'lib/teamlab/Modules/Calendar.rb', line 84

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

#get_access_parameters(calendar_id) ⇒ Object



24
25
26
# File 'lib/teamlab/Modules/Calendar.rb', line 24

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

#get_calendar(id) ⇒ Object



12
13
14
# File 'lib/teamlab/Modules/Calendar.rb', line 12

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

#get_calendar_events(start_date, end_date) ⇒ Object



32
33
34
# File 'lib/teamlab/Modules/Calendar.rb', line 32

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



36
37
38
# File 'lib/teamlab/Modules/Calendar.rb', line 36

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

#get_default_accessObject



8
9
10
# File 'lib/teamlab/Modules/Calendar.rb', line 8

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

#get_icalc_feed(calendar_id, signature) ⇒ Object



28
29
30
# File 'lib/teamlab/Modules/Calendar.rb', line 28

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


20
21
22
# File 'lib/teamlab/Modules/Calendar.rb', line 20

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

#get_subscription_listObject



16
17
18
# File 'lib/teamlab/Modules/Calendar.rb', line 16

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

#import_ical(calendar_id, file) ⇒ Object



54
55
56
# File 'lib/teamlab/Modules/Calendar.rb', line 54

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

#manage_subscriptions(states) ⇒ Object



70
71
72
# File 'lib/teamlab/Modules/Calendar.rb', line 70

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

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

TODO: OPTIONAL VARIABLES


90
91
92
# File 'lib/teamlab/Modules/Calendar.rb', line 90

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

#unsubscribe_from_event(event_id) ⇒ Object



94
95
96
# File 'lib/teamlab/Modules/Calendar.rb', line 94

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


60
61
62
# File 'lib/teamlab/Modules/Calendar.rb', line 60

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


66
67
68
# File 'lib/teamlab/Modules/Calendar.rb', line 66

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


76
77
78
# File 'lib/teamlab/Modules/Calendar.rb', line 76

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