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
- ASSOCIATION =
{ event_type: EventType, event_guests: Guest, cancellation: InviteeCancellation, invitees_counter: InviteesCounter, location: Location }.freeze
Constants included from ModelUtils
Instance Attribute Summary collapse
-
#cancellation ⇒ 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<Guest>
Additional people added to an event by an invitee.
-
#event_memberships ⇒ Array<User>
Event membership list.
-
#event_type ⇒ EventType
Reference to Event Type associated with this event.
-
#invitees_counter ⇒ 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.
Instance Method Summary collapse
-
#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 ⇒ InviteeCancellation
Provides data pertaining to the cancellation of the Invitee.
64 65 66 |
# File 'lib/calendly/models/event.rb', line 64 def cancellation @cancellation end |
#created_at ⇒ Time
Moment when user record was first created.
52 53 54 |
# File 'lib/calendly/models/event.rb', line 52 def created_at @created_at end |
#end_time ⇒ Time
Moment when event is (or was) scheduled to end.
48 49 50 |
# File 'lib/calendly/models/event.rb', line 48 def end_time @end_time end |
#event_guests ⇒ Array<Guest>
Additional people added to an event by an invitee.
80 81 82 |
# File 'lib/calendly/models/event.rb', line 80 def event_guests @event_guests end |
#event_memberships ⇒ Array<User>
Event membership list.
76 77 78 |
# File 'lib/calendly/models/event.rb', line 76 def event_memberships @event_memberships end |
#event_type ⇒ EventType
Reference to Event Type associated with this event.
60 61 62 |
# File 'lib/calendly/models/event.rb', line 60 def event_type @event_type end |
#invitees_counter ⇒ InviteesCounter
invitees counter.
68 69 70 |
# File 'lib/calendly/models/event.rb', line 68 def invitees_counter @invitees_counter end |
#location ⇒ Calendly::Location
location in this event.
72 73 74 |
# File 'lib/calendly/models/event.rb', line 72 def location @location end |
#name ⇒ String
Name of the event.
36 37 38 |
# File 'lib/calendly/models/event.rb', line 36 def name @name end |
#start_time ⇒ Time
Moment when event is (or was) scheduled to begin.
44 45 46 |
# File 'lib/calendly/models/event.rb', line 44 def start_time @start_time end |
#status ⇒ String
Whether the event is active or canceled.
40 41 42 |
# File 'lib/calendly/models/event.rb', line 40 def status @status end |
#updated_at ⇒ Time
Moment when user record was last updated.
56 57 58 |
# File 'lib/calendly/models/event.rb', line 56 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
32 33 34 |
# File 'lib/calendly/models/event.rb', line 32 def uri @uri end |
#uuid ⇒ String
unique id of the Event object.
28 29 30 |
# File 'lib/calendly/models/event.rb', line 28 def uuid @uuid end |
Instance Method Details
#fetch ⇒ Calendly::Event
Get Scheduled Event associated with self.
89 90 91 |
# File 'lib/calendly/models/event.rb', line 89 def fetch client.scheduled_event uuid end |
#invitees(options: nil) ⇒ Array<Calendly::Invitee>
Returns all Event Invitees associated with self.
Pass this to get the next portion of collection. Accepts comma-separated list of field:direction values.
108 109 110 111 112 113 |
# File 'lib/calendly/models/event.rb', line 108 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
116 117 118 119 |
# File 'lib/calendly/models/event.rb', line 116 def invitees!(options: nil) @cached_invitees = nil invitees options: end |