Module: Calendly::ModelUtils
- Included in:
- ActivityLogEntry, Event, EventType, EventTypeAvailableTime, EventTypeCustomQuestion, EventTypeProfile, Guest, Invitee, InviteeCancellation, InviteeNoShow, InviteePayment, InviteeQuestionAndAnswer, InviteeTracking, InviteesCounter, Location, Organization, OrganizationInvitation, OrganizationMembership, RoutingForm, RoutingFormQuestion, RoutingFormSubmission, RoutingFormSubmissionEventTypeResult, RoutingFormSubmissionQuestionAndAnswer, RoutingFormSubmissionTracking, Team, User, WebhookSubscription
- Defined in:
- lib/calendly/models/model_utils.rb
Overview
Calendly model utility.
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- UUID_FORMAT =
UUID’s format is ASCII. refs to official release note of October 2021.
'[[:ascii:]]+'
Class Method Summary collapse
Instance Method Summary collapse
-
#client ⇒ Calendly::Client
Returns api client.
-
#id ⇒ String
Alias of uuid.
- #initialize(attrs = nil, client = nil) ⇒ Object
-
#inspect ⇒ String
Self object description human readable in CLI.
Class Method Details
.included(base) ⇒ Object
76 77 78 |
# File 'lib/calendly/models/model_utils.rb', line 76 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#client ⇒ Calendly::Client
Returns api client.
25 26 27 28 29 |
# File 'lib/calendly/models/model_utils.rb', line 25 def client raise Error.new('@client is not ready.') if !@client || !@client.is_a?(Client) @client end |
#id ⇒ String
Alias of uuid.
37 38 39 40 41 |
# File 'lib/calendly/models/model_utils.rb', line 37 def id raise Error.new('uuid is not defined.') unless defined? uuid uuid end |
#initialize(attrs = nil, client = nil) ⇒ Object
14 15 16 17 |
# File 'lib/calendly/models/model_utils.rb', line 14 def initialize(attrs = nil, client = nil) @client = client set_attributes attrs end |
#inspect ⇒ String
Self object description human readable in CLI.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/calendly/models/model_utils.rb', line 48 def inspect att_info = [] inspect_attributes.each do |att| next unless respond_to? att att_info << "#{att}=#{send(att).inspect}" end att_info << '..' "\#<#{self.class}:#{object_id} #{att_info.join(', ')}>" end |