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/(\w+)\z}.freeze
- TIME_FIELDS =
i[start_time end_time created_at updated_at].freeze
- ASSOCIATION =
{event_type: EventType}.freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Moment when user record was first created.
-
#end_time ⇒ Time
Moment when event is (or was) scheduled to end.
-
#event_type ⇒ EventType
Reference to Event Type associated with this event.
-
#invitees_counter_active ⇒ Integer
number of active invitees in this event.
-
#invitees_counter_limit ⇒ Integer
max invitees in this event.
-
#invitees_counter_total ⇒ Integer
number of total invitees in this event.
-
#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(opts = {}) ⇒ Array<Calendly::Invitee>
Returns all Event Invitees associated with self.
- #invitees!(opts = {}) ⇒ Object
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#created_at ⇒ Time
Moment when user record was first created.
36 37 38 |
# File 'lib/calendly/models/event.rb', line 36 def created_at @created_at end |
#end_time ⇒ Time
Moment when event is (or was) scheduled to end.
33 34 35 |
# File 'lib/calendly/models/event.rb', line 33 def end_time @end_time end |
#event_type ⇒ EventType
Reference to Event Type associated with this event.
43 44 45 |
# File 'lib/calendly/models/event.rb', line 43 def event_type @event_type end |
#invitees_counter_active ⇒ Integer
number of active invitees in this event.
54 55 56 |
# File 'lib/calendly/models/event.rb', line 54 def invitees_counter_active @invitees_counter_active end |
#invitees_counter_limit ⇒ Integer
max invitees in this event.
57 58 59 |
# File 'lib/calendly/models/event.rb', line 57 def invitees_counter_limit @invitees_counter_limit end |
#invitees_counter_total ⇒ Integer
number of total invitees in this event.
51 52 53 |
# File 'lib/calendly/models/event.rb', line 51 def invitees_counter_total @invitees_counter_total end |
#location ⇒ Calendly::Location
location in this event.
47 48 49 |
# File 'lib/calendly/models/event.rb', line 47 def location @location end |
#name ⇒ String
Name of the event.
24 25 26 |
# File 'lib/calendly/models/event.rb', line 24 def name @name end |
#start_time ⇒ Time
Moment when event is (or was) scheduled to begin.
30 31 32 |
# File 'lib/calendly/models/event.rb', line 30 def start_time @start_time end |
#status ⇒ String
Whether the event is active or canceled.
27 28 29 |
# File 'lib/calendly/models/event.rb', line 27 def status @status end |
#updated_at ⇒ Time
Moment when user record was last updated.
39 40 41 |
# File 'lib/calendly/models/event.rb', line 39 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
21 22 23 |
# File 'lib/calendly/models/event.rb', line 21 def uri @uri end |
#uuid ⇒ String
unique id of the Event object.
18 19 20 |
# File 'lib/calendly/models/event.rb', line 18 def uuid @uuid end |
Instance Method Details
#fetch ⇒ Calendly::Event
Get Scheduled Event associated with self.
66 67 68 |
# File 'lib/calendly/models/event.rb', line 66 def fetch client.scheduled_event uuid end |
#invitees(opts = {}) ⇒ 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.
85 86 87 88 89 90 |
# File 'lib/calendly/models/event.rb', line 85 def invitees(opts = {}) return @cached_invitees if @cached_invitees request_proc = proc { || client.event_invitees uuid, } @cached_invitees = auto_pagination request_proc, opts end |
#invitees!(opts = {}) ⇒ Object
93 94 95 96 |
# File 'lib/calendly/models/event.rb', line 93 def invitees!(opts = {}) @cached_invitees = nil invitees opts end |