Skip to content
This repository was archived by the owner on Jun 29, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/calendly/models/model_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module ModelUtils
# @param [Calendly::Client] the api client.
def initialize(attrs = nil, client = nil)
@client = client
@__data = attrs || {}
set_attributes attrs
end

Expand Down Expand Up @@ -47,15 +48,21 @@ def id
# @since 0.0.1
def inspect
att_info = []
inspect_attributes.each do |att|

# Print out all the attributes, showing the key ones (defined in inspect_attributes) first
(inspect_attributes + @__data.keys).uniq.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

def to_h
@__data
end

module ClassMethods
def extract_uuid_match(str)
return unless defined? self::UUID_RE
Expand Down