Class: Calendlyr::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/calendlyr/client.rb

Constant Summary collapse

BASE_URL =
"https://api.calendly.com"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/calendlyr/client.rb', line 7

def initialize(token:)
  @token = token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



5
6
7
# File 'lib/calendlyr/client.rb', line 5

def token
  @token
end

Instance Method Details

#data_complianceObject



48
49
50
# File 'lib/calendlyr/client.rb', line 48

def data_compliance
  DataComplianceResource.new(self)
end

#event_inviteesObject



36
37
38
# File 'lib/calendlyr/client.rb', line 36

def event_invitees
  EventInviteeResource.new(self)
end

#event_typesObject



28
29
30
# File 'lib/calendlyr/client.rb', line 28

def event_types
  EventTypeResource.new(self)
end

#eventsObject



32
33
34
# File 'lib/calendlyr/client.rb', line 32

def events
  EventResource.new(self)
end

#inspectObject

Avoid returning #<Calendlyr::Client @token=“token” …>



53
54
55
# File 'lib/calendlyr/client.rb', line 53

def inspect
  "#<Calendlyr::Client>"
end

#me(force_reload: false) ⇒ Object



11
12
13
14
# File 'lib/calendlyr/client.rb', line 11

def me(force_reload: false)
  @me = nil if force_reload
  @me ||= users.me
end

#organizationObject



16
17
18
# File 'lib/calendlyr/client.rb', line 16

def organization
  me.organization
end

#organizationsObject



24
25
26
# File 'lib/calendlyr/client.rb', line 24

def organizations
  OrganizationResource.new(self)
end


40
41
42
# File 'lib/calendlyr/client.rb', line 40

def scheduling_links
  SchedulingLinkResource.new(self)
end

#usersObject



20
21
22
# File 'lib/calendlyr/client.rb', line 20

def users
  UserResource.new(self)
end

#webhooksObject



44
45
46
# File 'lib/calendlyr/client.rb', line 44

def webhooks
  WebhookResource.new(self)
end