Class: Calendly::Event
- Inherits:
-
Object
- Object
- Calendly::Event
- Includes:
- ModelUtils
- Defined in:
- lib/calendly/models/event.rb
Overview
Calendly’s event model. A meeting that has been scheduled.
Constant Summary collapse
- UUID_RE =
%r{\A#{Client::API_HOST}/scheduled_events/(#{UUID_FORMAT})\z}.freeze
- TIME_FIELDS =
%i[start_time end_time created_at updated_at].freeze
Constants included from ModelUtils
Instance Attribute Summary collapse
-
#cancellation ⇒ Calendly::InviteeCancellation
Provides data pertaining to the cancellation of the Invitee.
-
#created_at ⇒ Time
Moment when user record was first created.
-
#end_time ⇒ Time
Moment when event is (or was) scheduled to end.
-
#event_guests ⇒ Array<Calendly::Guest>
Additional people added to an event by an invitee.
-
#event_memberships ⇒ Array<Calendly::User>
Event membership list.
-
#event_type ⇒ Calendly::EventType
Reference to Event Type associated with this event.
-
#invitees_counter ⇒ Calendly::InviteesCounter
invitees counter.
-
#location ⇒ Calendly::Location
location in this event.
-
#name ⇒ String
Name of the event.
-
#start_time ⇒ Time
Moment when event is (or was) scheduled to begin.
-
#status ⇒ String
Whether the event is active or canceled.
-
#updated_at ⇒ Time
Moment when user record was last updated.
-
#uri ⇒ String
Canonical resource reference.
-
#uuid ⇒ String
unique id of the Event object.
Class Method Summary collapse
Instance Method Summary collapse
-
#cancel(options: nil) ⇒ Calendly::InviteeCancellation
Cancels specified event.
-
#fetch ⇒ Calendly::Event
Get Scheduled Event associated with self.
-
#invitees(options: nil) ⇒ Array<Calendly::Invitee>
Returns all Event Invitees associated with self.
- #invitees!(options: nil) ⇒ Object
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#cancellation ⇒ Calendly::InviteeCancellation
Provides data pertaining to the cancellation of the Invitee.
59 60 61 |
# File 'lib/calendly/models/event.rb', line 59 def cancellation @cancellation end |
#created_at ⇒ Time
Moment when user record was first created.
47 48 49 |
# File 'lib/calendly/models/event.rb', line 47 def created_at @created_at end |
#end_time ⇒ Time
Moment when event is (or was) scheduled to end.
43 44 45 |
# File 'lib/calendly/models/event.rb', line 43 def end_time @end_time end |
#event_guests ⇒ Array<Calendly::Guest>
Additional people added to an event by an invitee.
75 76 77 |
# File 'lib/calendly/models/event.rb', line 75 def event_guests @event_guests end |
#event_memberships ⇒ Array<Calendly::User>
Event membership list.
71 72 73 |
# File 'lib/calendly/models/event.rb', line 71 def event_memberships @event_memberships end |
#event_type ⇒ Calendly::EventType
Reference to Event Type associated with this event.
55 56 57 |
# File 'lib/calendly/models/event.rb', line 55 def event_type @event_type end |
#invitees_counter ⇒ Calendly::InviteesCounter
invitees counter.
63 64 65 |
# File 'lib/calendly/models/event.rb', line 63 def invitees_counter @invitees_counter end |
#location ⇒ Calendly::Location
location in this event.
67 68 69 |
# File 'lib/calendly/models/event.rb', line 67 def location @location end |
#name ⇒ String
Name of the event.
31 32 33 |
# File 'lib/calendly/models/event.rb', line 31 def name @name end |
#start_time ⇒ Time
Moment when event is (or was) scheduled to begin.
39 40 41 |
# File 'lib/calendly/models/event.rb', line 39 def start_time @start_time end |
#status ⇒ String
Whether the event is active or canceled.
35 36 37 |
# File 'lib/calendly/models/event.rb', line 35 def status @status end |
#updated_at ⇒ Time
Moment when user record was last updated.
51 52 53 |
# File 'lib/calendly/models/event.rb', line 51 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
27 28 29 |
# File 'lib/calendly/models/event.rb', line 27 def uri @uri end |
#uuid ⇒ String
unique id of the Event object.
23 24 25 |
# File 'lib/calendly/models/event.rb', line 23 def uuid @uuid end |
Class Method Details
.association ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/calendly/models/event.rb', line 11 def self.association { event_type: EventType, event_guests: Guest, cancellation: InviteeCancellation, invitees_counter: InviteesCounter, location: Location } end |
Instance Method Details
#cancel(options: nil) ⇒ Calendly::InviteeCancellation
Cancels specified event.
97 98 99 |
# File 'lib/calendly/models/event.rb', line 97 def cancel(options: nil) client.cancel_event uuid, options: end |
#fetch ⇒ Calendly::Event
Get Scheduled Event associated with self.
84 85 86 |
# File 'lib/calendly/models/event.rb', line 84 def fetch client.scheduled_event uuid end |
#invitees(options: nil) ⇒ Array<Calendly::Invitee>
Returns all Event Invitees associated with self.
114 115 116 117 118 119 |
# File 'lib/calendly/models/event.rb', line 114 def invitees(options: nil) return @cached_invitees if defined?(@cached_invitees) && @cached_invitees request_proc = proc { |opts| client.event_invitees uuid, options: opts } @cached_invitees = auto_pagination request_proc, end |
#invitees!(options: nil) ⇒ Object
122 123 124 125 |
# File 'lib/calendly/models/event.rb', line 122 def invitees!(options: nil) @cached_invitees = nil invitees options: end |