Module: Calendly::ModelUtils
- Included in:
- Event, EventType, Invitee, InviteeQuestionAndAnswer, InviteeTracking, Location, Organization, OrganizationInvitation, OrganizationMembership, User, WebhookSubscription
- Defined in:
- lib/calendly/models/model_utils.rb
Overview
Calendly model utility.
Defined Under Namespace
Modules: ClassMethods
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 ⇒ Object
Class Method Details
.included(base) ⇒ Object
57 58 59 |
# File 'lib/calendly/models/model_utils.rb', line 57 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#client ⇒ Calendly::Client
Returns api client.
21 22 23 24 25 |
# File 'lib/calendly/models/model_utils.rb', line 21 def client raise Error.new('@client is not ready.') if !@client || !@client.is_a?(Client) @client end |
#id ⇒ String
alias of uuid.
33 34 35 36 37 |
# File 'lib/calendly/models/model_utils.rb', line 33 def id raise Error.new('uuid is not defined.') unless defined? uuid uuid end |
#initialize(attrs = nil, client = nil) ⇒ Object
10 11 12 13 |
# File 'lib/calendly/models/model_utils.rb', line 10 def initialize(attrs = nil, client = nil) @client = client set_attributes attrs end |
#inspect ⇒ Object
39 40 41 42 |
# File 'lib/calendly/models/model_utils.rb', line 39 def inspect description = "uuid:#{uuid}" if respond_to? :uuid "\#<#{self.class}:#{object_id} #{description}>" end |