Class: Calendly::Event

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from ModelUtils

#client, #id, included, #initialize, #inspect

Instance Attribute Details

#created_atTime

Moment when user record was first created.

Returns:

  • (Time)


32
33
34
# File 'lib/calendly/models/event.rb', line 32

def created_at
  @created_at
end

#end_timeTime

Moment when event is (or was) scheduled to end.

Returns:

  • (Time)


29
30
31
# File 'lib/calendly/models/event.rb', line 29

def end_time
  @end_time
end

#event_typeEventType

Reference to Event Type associated with this event.

Returns:



39
40
41
# File 'lib/calendly/models/event.rb', line 39

def event_type
  @event_type
end

#invitees_counter_activeInteger

number of active invitees in this event.

Returns:

  • (Integer)


50
51
52
# File 'lib/calendly/models/event.rb', line 50

def invitees_counter_active
  @invitees_counter_active
end

#invitees_counter_limitInteger

max invitees in this event.

Returns:

  • (Integer)


53
54
55
# File 'lib/calendly/models/event.rb', line 53

def invitees_counter_limit
  @invitees_counter_limit
end

#invitees_counter_totalInteger

number of total invitees in this event.

Returns:

  • (Integer)


47
48
49
# File 'lib/calendly/models/event.rb', line 47

def invitees_counter_total
  @invitees_counter_total
end

#locationCalendly::Location

location in this event.

Returns:



43
44
45
# File 'lib/calendly/models/event.rb', line 43

def location
  @location
end

#nameString

Name of the event.

Returns:

  • (String)


20
21
22
# File 'lib/calendly/models/event.rb', line 20

def name
  @name
end

#start_timeTime

Moment when event is (or was) scheduled to begin.

Returns:

  • (Time)


26
27
28
# File 'lib/calendly/models/event.rb', line 26

def start_time
  @start_time
end

#statusString

Whether the event is active or canceled.

Returns:

  • (String)


23
24
25
# File 'lib/calendly/models/event.rb', line 23

def status
  @status
end

#updated_atTime

Moment when user record was last updated.

Returns:

  • (Time)


35
36
37
# File 'lib/calendly/models/event.rb', line 35

def updated_at
  @updated_at
end

#uriString

Canonical resource reference.

Returns:

  • (String)


17
18
19
# File 'lib/calendly/models/event.rb', line 17

def uri
  @uri
end

#uuidString

unique id of the Event object.

Returns:

  • (String)


14
15
16
# File 'lib/calendly/models/event.rb', line 14

def uuid
  @uuid
end

Instance Method Details

#fetchCalendly::Event

Get Scheduled Event associated with self.

Returns:

Raises:

Since:

  • 0.1.0



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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional request parameters.

Options Hash (opts):

  • :count (Integer)

    Number of rows to return.

  • :email (String)

    Filter by email.

  • :page_token (String)
  • :sort (String)

    Order results by the specified field and directin.

  • :status (String)

    Whether the scheduled event is active or canceled.

Returns:

Raises:

Since:

  • 0.1.0



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 { |options| client.event_invitees uuid, options }
  @cached_invitees = auto_pagination request_proc, opts
end

#invitees!(opts = {}) ⇒ Object

Since:

  • 0.2.0



89
90
91
92
# File 'lib/calendly/models/event.rb', line 89

def invitees!(opts = {})
  @cached_invitees = nil
  invitees opts
end