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.
32 33 34 |
# File 'lib/calendly/models/event.rb', line 32 def created_at @created_at end |
#end_time ⇒ Time
Moment when event is (or was) scheduled to end.
29 30 31 |
# File 'lib/calendly/models/event.rb', line 29 def end_time @end_time end |
#event_type ⇒ EventType
Reference to Event Type associated with this event.
39 40 41 |
# File 'lib/calendly/models/event.rb', line 39 def event_type @event_type end |
#invitees_counter_active ⇒ Integer
number of active invitees in this event.
50 51 52 |
# File 'lib/calendly/models/event.rb', line 50 def invitees_counter_active @invitees_counter_active end |
#invitees_counter_limit ⇒ Integer
max invitees in this event.
53 54 55 |
# File 'lib/calendly/models/event.rb', line 53 def invitees_counter_limit @invitees_counter_limit end |
#invitees_counter_total ⇒ Integer
number of total invitees in this event.
47 48 49 |
# File 'lib/calendly/models/event.rb', line 47 def invitees_counter_total @invitees_counter_total end |
#location ⇒ Calendly::Location
location in this event.
43 44 45 |
# File 'lib/calendly/models/event.rb', line 43 def location @location end |
#name ⇒ String
Name of the event.
20 21 22 |
# File 'lib/calendly/models/event.rb', line 20 def name @name end |
#start_time ⇒ Time
Moment when event is (or was) scheduled to begin.
26 27 28 |
# File 'lib/calendly/models/event.rb', line 26 def start_time @start_time end |
#status ⇒ String
Whether the event is active or canceled.
23 24 25 |
# File 'lib/calendly/models/event.rb', line 23 def status @status end |
#updated_at ⇒ Time
Moment when user record was last updated.
35 36 37 |
# File 'lib/calendly/models/event.rb', line 35 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
17 18 19 |
# File 'lib/calendly/models/event.rb', line 17 def uri @uri end |
#uuid ⇒ String
unique id of the Event object.
14 15 16 |
# File 'lib/calendly/models/event.rb', line 14 def uuid @uuid end |
Instance Method Details
#fetch ⇒ Calendly::Event
Get Scheduled Event associated with self.
62 63 64 |
# File 'lib/calendly/models/event.rb', line 62 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.
81 82 83 84 85 86 |
# File 'lib/calendly/models/event.rb', line 81 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
89 90 91 92 |
# File 'lib/calendly/models/event.rb', line 89 def invitees!(opts = {}) @cached_invitees = nil invitees opts end |