Class: Calendly::User
- Inherits:
-
Object
- Object
- Calendly::User
- Includes:
- ModelUtils
- Defined in:
- lib/calendly/models/user.rb
Overview
Calendly’s user model. Primary account details of a specific user.
Constant Summary collapse
- UUID_RE =
%r{\A#{Client::API_HOST}/users/(\w+)\z}.freeze
- TIME_FIELDS =
i[created_at updated_at].freeze
Instance Attribute Summary collapse
-
#avatar_url ⇒ String
URL of user’s avatar image.
-
#created_at ⇒ Time
Moment when user record was first created.
-
#email ⇒ String
User’s email address.
-
#name ⇒ String
User’s human-readable name.
-
#scheduling_url ⇒ String
URL of user’s event page.
-
#slug ⇒ String
Unique readable value used in page URL.
-
#timezone ⇒ String
Timezone offest to use when presenting time information to user.
-
#updated_at ⇒ Time
Moment when user record was last updated.
-
#uri ⇒ String
Canonical resource reference.
-
#uuid ⇒ String
unique id of the User object.
Instance Method Summary collapse
-
#event_types(opts = {}) ⇒ Array<Calendly::EventType>
Returns all Event Types associated with self.
-
#fetch ⇒ Calendly::User
Get basic information associated with self.
-
#organization_membership ⇒ Calendly::OrganizationMembership
Get an organization membership information associated with self.
-
#scheduled_events(opts = {}) ⇒ Array<Calendly::Event>
Returns all Scheduled Events associated with self.
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#avatar_url ⇒ String
URL of user’s avatar image.
28 29 30 |
# File 'lib/calendly/models/user.rb', line 28 def avatar_url @avatar_url end |
#created_at ⇒ Time
Moment when user record was first created.
37 38 39 |
# File 'lib/calendly/models/user.rb', line 37 def created_at @created_at end |
#email ⇒ String
User’s email address.
25 26 27 |
# File 'lib/calendly/models/user.rb', line 25 def email @email end |
#name ⇒ String
User’s human-readable name.
19 20 21 |
# File 'lib/calendly/models/user.rb', line 19 def name @name end |
#scheduling_url ⇒ String
URL of user’s event page.
31 32 33 |
# File 'lib/calendly/models/user.rb', line 31 def scheduling_url @scheduling_url end |
#slug ⇒ String
Unique readable value used in page URL.
22 23 24 |
# File 'lib/calendly/models/user.rb', line 22 def slug @slug end |
#timezone ⇒ String
Timezone offest to use when presenting time information to user.
34 35 36 |
# File 'lib/calendly/models/user.rb', line 34 def timezone @timezone end |
#updated_at ⇒ Time
Moment when user record was last updated.
40 41 42 |
# File 'lib/calendly/models/user.rb', line 40 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
16 17 18 |
# File 'lib/calendly/models/user.rb', line 16 def uri @uri end |
#uuid ⇒ String
unique id of the User object.
13 14 15 |
# File 'lib/calendly/models/user.rb', line 13 def uuid @uuid end |
Instance Method Details
#event_types(opts = {}) ⇒ Array<Calendly::EventType>
Returns all Event Types associated with self.
Accepts comma-separated list of field:direction values.
76 77 78 79 |
# File 'lib/calendly/models/user.rb', line 76 def event_types(opts = {}) request_proc = proc { || client.event_types uri, } auto_pagination request_proc, opts end |
#fetch ⇒ Calendly::User
Get basic information associated with self.
49 50 51 |
# File 'lib/calendly/models/user.rb', line 49 def fetch client.user uuid end |
#organization_membership ⇒ Calendly::OrganizationMembership
Get an organization membership information associated with self.
59 60 61 62 |
# File 'lib/calendly/models/user.rb', line 59 def organization_membership mems, = client.memberships_by_user uri mems.first end |
#scheduled_events(opts = {}) ⇒ Array<Calendly::Event>
Returns all Scheduled Events associated with self.
Accepts comma-separated list of field:direction values.
97 98 99 100 |
# File 'lib/calendly/models/user.rb', line 97 def scheduled_events(opts = {}) request_proc = proc { || client.scheduled_events uri, } auto_pagination request_proc, opts end |