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
58 59 60 |
# File 'lib/calendly/models/model_utils.rb', line 58 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#client ⇒ Calendly::Client
Returns api client.
22 23 24 25 26 |
# File 'lib/calendly/models/model_utils.rb', line 22 def client raise Error.new('@client is not ready.') if !@client || !@client.is_a?(Client) @client end |
#id ⇒ String
alias of uuid.
34 35 36 37 38 |
# File 'lib/calendly/models/model_utils.rb', line 34 def id raise Error.new('uuid is not defined.') unless defined? uuid uuid end |
#initialize(attrs = nil, client = nil) ⇒ Object
11 12 13 14 |
# File 'lib/calendly/models/model_utils.rb', line 11 def initialize(attrs = nil, client = nil) @client = client set_attributes attrs end |
#inspect ⇒ Object
40 41 42 43 |
# File 'lib/calendly/models/model_utils.rb', line 40 def inspect description = "uuid:#{uuid}" if respond_to? :uuid "\#<#{self.class}:#{object_id} #{description}>" end |