Class: Teamlab::Calendar
- Inherits:
-
Object
- Object
- Teamlab::Calendar
- Defined in:
- lib/teamlab/modules/calendar.rb
Instance Method Summary collapse
-
#add_event(calendar_id, name, options = {}) ⇒ Object
TODO: OPTIONAL VARIABLES.
- #create_calendar(name, time_zone, options = {}) ⇒ Object
- #create_calendar_by_ical_link(ical_url, name, options = {}) ⇒ Object
- #delete_calendar(calendar_id) ⇒ Object
- #delete_event_series(event_id) ⇒ Object
- #get_access_parameters(calendar_id) ⇒ Object
- #get_calendar(id) ⇒ Object
- #get_calendar_events(start_date, end_date) ⇒ Object
- #get_calendars_and_subscriptions(start_date, end_date) ⇒ Object
- #get_default_access ⇒ Object
- #get_icalc_feed(calendar_id, signature) ⇒ Object
- #get_icalc_link(calendar_id) ⇒ Object
- #get_subscription_list ⇒ Object
- #import_ical(calendar_id, file) ⇒ Object
-
#initialize ⇒ Calendar
constructor
A new instance of Calendar.
- #manage_subscriptions(states) ⇒ Object
-
#remove_event(event_id, options = {}) ⇒ Object
TODO: OPTIONAL VARIABLES.
- #unsubscribe_from_event(event_id) ⇒ Object
-
#update_calendar(calendar_id, name, time_zone, options = {}) ⇒ Object
TODO: OPTIONAL VARIABLES.
-
#update_calendar_user_view(calendar_id, name, time_zone, options = {}) ⇒ Object
TODO: OPTIONAL VARIABLES.
-
#update_event(calendar_id, event_id, name, options = {}) ⇒ Object
TODO: OPTIONAL VARIABLES.
Constructor Details
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, = {}) @request.post([calendar_id.to_s, 'event'], { name: name }.merge()) 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, = {}) @request.post('', { name: name, timeZone: time_zone }.merge()) end |
#create_calendar_by_ical_link(ical_url, name, options = {}) ⇒ Object
43 44 45 |
# File 'lib/teamlab/modules/calendar.rb', line 43 def create_calendar_by_ical_link(ical_url, name, = {}) @request.post(%w(calendarurl), { iCalUrl: ical_url, name: name }.merge()) 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_access ⇒ Object
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 |
#get_icalc_link(calendar_id) ⇒ Object
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_list ⇒ Object
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, = {}) @request.delete(['events', event_id.to_s, 'custom'], ) 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, = {}) @request.put([calendar_id.to_s], { name: name, timeZone: time_zone }.merge()) 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, = {}) @request.put([calendar_id.to_s, 'view'], { name: name, timeZone: time_zone }.merge()) 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, = {}) @request.put([calendar_id.to_s, event_id.to_s], { name: name }.merge()) end |