Class: Nylas::Event
Overview
Structure to represent a the Event Schema.
Instance Attribute Summary collapse
-
#notify_participants ⇒ Object
Returns the value of attribute notify_participants.
Attributes included from Model
Instance Method Summary collapse
- #busy? ⇒ Boolean
-
#generate_ics(ical_uid: nil, method: nil, prodid: nil) ⇒ String
Generate an ICS file server-side, from an Event.
- #read_only? ⇒ Boolean
- #rsvp(status, notify_participants:) ⇒ Object
- #save ⇒ Object
Methods included from Model
#auth_method, #create, #destroy, #execute, included, #model_class, #persisted?, #reload, #resource_path, #resources_path, #save_all_attributes, #to_json, #update, #update_all_attributes
Instance Attribute Details
#notify_participants ⇒ Object
Returns the value of attribute notify_participants.
48 49 50 |
# File 'lib/nylas/event.rb', line 48 def notify_participants @notify_participants end |
Instance Method Details
#busy? ⇒ Boolean
50 51 52 |
# File 'lib/nylas/event.rb', line 50 def busy? busy end |
#generate_ics(ical_uid: nil, method: nil, prodid: nil) ⇒ String
Generate an ICS file server-side, from an Event
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/nylas/event.rb', line 76 def generate_ics(ical_uid: nil, method: nil, prodid: nil) raise ArgumentError, "Cannot generate an ICS file for an event without a Calendar ID or when set" unless calendar_id && self.when payload = build_ics_event_payload(ical_uid, method, prodid) response = api.execute( method: :post, path: "#{resources_path}/to-ics", payload: JSON.dump(payload) ) response[:ics] end |
#read_only? ⇒ Boolean
54 55 56 |
# File 'lib/nylas/event.rb', line 54 def read_only? read_only end |
#rsvp(status, notify_participants:) ⇒ Object
65 66 67 68 69 |
# File 'lib/nylas/event.rb', line 65 def rsvp(status, notify_participants:) rsvp = Rsvp.new(api: api, status: status, notify_participants: notify_participants, event_id: id, account_id: account_id) rsvp.save end |
#save ⇒ Object
58 59 60 61 62 63 |
# File 'lib/nylas/event.rb', line 58 def save validate format_reminder_minutes super end |