calendlyr 0.3.3 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -5
  3. data/Gemfile +1 -5
  4. data/README.md +22 -18
  5. data/bin/console +3 -3
  6. data/{calendly.gemspec → calendlyr.gemspec} +3 -3
  7. data/lib/{calendly → calendlyr}/client.rb +6 -7
  8. data/lib/{calendly → calendlyr}/collection.rb +1 -1
  9. data/lib/{calendly → calendlyr}/error.rb +1 -1
  10. data/lib/{calendly → calendlyr}/object.rb +1 -1
  11. data/lib/{calendly → calendlyr}/objects/event_invitees.rb +1 -1
  12. data/lib/{calendly → calendlyr}/objects/event_types.rb +1 -1
  13. data/lib/{calendly → calendlyr}/objects/events.rb +1 -1
  14. data/lib/{calendly → calendlyr}/objects/invitations.rb +1 -1
  15. data/lib/{calendly → calendlyr}/objects/memberships.rb +1 -1
  16. data/lib/{calendly → calendlyr}/objects/organizations.rb +1 -1
  17. data/lib/{calendly → calendlyr}/objects/scheduling_links.rb +1 -1
  18. data/lib/{calendly → calendlyr}/objects/users.rb +1 -1
  19. data/lib/{calendly → calendlyr}/objects/webhooks.rb +1 -1
  20. data/lib/{calendly → calendlyr}/resource.rb +2 -2
  21. data/lib/{calendly → calendlyr}/resources/data_compliance.rb +1 -1
  22. data/lib/{calendly → calendlyr}/resources/event_invitees.rb +1 -1
  23. data/lib/{calendly → calendlyr}/resources/event_types.rb +1 -1
  24. data/lib/{calendly → calendlyr}/resources/events.rb +1 -1
  25. data/lib/{calendly → calendlyr}/resources/organizations.rb +1 -1
  26. data/lib/{calendly → calendlyr}/resources/scheduling_links.rb +1 -1
  27. data/lib/{calendly → calendlyr}/resources/users.rb +1 -1
  28. data/lib/{calendly → calendlyr}/resources/webhooks.rb +1 -1
  29. data/lib/calendlyr/version.rb +3 -0
  30. data/lib/calendlyr.rb +35 -0
  31. data/test/calendlyr/client_test.rb +8 -0
  32. data/test/calendlyr/object_test.rb +21 -0
  33. data/test/{calendly → calendlyr}/resources/data_compliance.rb +0 -0
  34. data/test/{calendly → calendlyr}/resources/event_invitees_test.rb +3 -3
  35. data/test/{calendly → calendlyr}/resources/event_types_test.rb +3 -3
  36. data/test/{calendly → calendlyr}/resources/events_test.rb +3 -3
  37. data/test/{calendly → calendlyr}/resources/organizations_test.rb +15 -15
  38. data/test/{calendly → calendlyr}/resources/scheduling_links.rb +0 -0
  39. data/test/{calendly → calendlyr}/resources/users_test.rb +9 -9
  40. data/test/{calendly → calendlyr}/resources/webhooks_test.rb +3 -3
  41. data/test/{calendly_test.rb → calendlyr_test.rb} +2 -2
  42. data/test/test_helper.rb +3 -3
  43. metadata +50 -50
  44. data/lib/calendly/version.rb +0 -3
  45. data/lib/calendly.rb +0 -35
  46. data/test/calendly/client_test.rb +0 -8
  47. data/test/calendly/object_test.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1154b32aa1af6668b71d74fb9af0e8bd695b53c21fc49d6ed45fbee180bd5a74
4
- data.tar.gz: bb85f5220261459ebf3fd4304fa207be57ac6b5a8226202d9ac2816064b3229e
3
+ metadata.gz: 716fb90f54ab5c73f5441ccb7d8d6f8e636bceb3b3f55a6a9053fc06adabb2b0
4
+ data.tar.gz: 6bebccb4df4028bfdbad116fdef8b49768e640f4858dbb1fc7a930d98cf558f0
5
5
  SHA512:
6
- metadata.gz: a4f4ccb083646d19c45599294ba2684b302960cbff32d6eac1ab8c6f02f1ce76f570b96057638b11623e4d4dcde3baa8e11dbfb905ce2fb93d3c71ac0fa353c8
7
- data.tar.gz: 86566019597243e8e84a1a48f1540e8e8cbbc14b8641ba9a816c62ce8267e446ab7ddb596ddeb1a94464d2536059f0ee975a2d1c4b39b9eb6a269b17ded2182e
6
+ metadata.gz: 79f76039110d8ff409c573229851e4cc130772f210a769d41bb2dac8ac05679b5a9db07a1d543604dc0e2858cc8c604dac16459fcdbbbeac9e059ce91f0b7267
7
+ data.tar.gz: 5de26c0f7b9da6389918ba123935902814ce125dbd193ed50596d06c329044bb161cacb7d9ce5d0b11a032157a01f3e06d6551b2b27d0e542b964f0a5dae11c2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.3.4]
6
+ * Renaming variables and directories Calendly to Calendlyr
7
+
5
8
  ## [0.3.3]
6
9
  * Fix - Error when trying to send an invitation through the organization
7
10
  * More testing = More coverage
@@ -25,8 +28,9 @@ All notable changes to this project will be documented in this file.
25
28
  ## 0.1.0
26
29
  * Birthday!
27
30
 
28
- [0.3.3]: https://github.com/araluce/calendly.rb/compare/v0.3.2...v0.3.3
29
- [0.3.2]: https://github.com/araluce/calendly.rb/compare/v0.3.0...v0.3.2
30
- [0.3.0]: https://github.com/araluce/calendly.rb/compare/v0.2.0...v0.3.0
31
- [0.2.0]: https://github.com/araluce/calendly.rb/compare/v0.1.1...v0.2.0
32
- [0.1.1]: https://github.com/araluce/calendly.rb/compare/v0.1.0...v0.1.1
31
+ [0.3.4]: https://github.com/araluce/calendlyr/compare/v0.3.3...v0.3.4
32
+ [0.3.3]: https://github.com/araluce/calendlyr/compare/v0.3.2...v0.3.3
33
+ [0.3.2]: https://github.com/araluce/calendlyr/compare/v0.3.0...v0.3.2
34
+ [0.3.0]: https://github.com/araluce/calendlyr/compare/v0.2.0...v0.3.0
35
+ [0.2.0]: https://github.com/araluce/calendlyr/compare/v0.1.1...v0.2.0
36
+ [0.1.1]: https://github.com/araluce/calendlyr/compare/v0.1.0...v0.1.1
data/Gemfile CHANGED
@@ -1,8 +1,4 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in calendly.gemspec
3
+ # Specify your gem's dependencies in calendlyr.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "minitest", "~> 5.0"
8
- gem "standard"
data/README.md CHANGED
@@ -1,18 +1,22 @@
1
- [![](https://img.shields.io/github/license/araluce/calendly.rb)](https://github.com/araluce/calendly.rb/blob/master/LICENSE.txt)
2
- ![](https://github.com/araluce/calendly.rb/actions/workflows/ci.yml/badge.svg)
3
- [![codecov](https://codecov.io/gh/araluce/calendly.rb/branch/master/graph/badge.svg?token=YSUU4PHM6Y)](https://codecov.io/gh/araluce/calendly.rb)
4
- [![GitHub version](https://badge.fury.io/gh/araluce%2Fcalendly.rb.svg)](https://badge.fury.io/gh/araluce%2Fcalendly.rb)
1
+ [![](https://img.shields.io/github/license/araluce/calendlyr)](https://github.com/araluce/calendlyr/blob/master/LICENSE.txt)
2
+ ![](https://github.com/araluce/calendlyr/actions/workflows/ci.yml/badge.svg)
3
+ [![codecov](https://codecov.io/gh/araluce/calendlyr/branch/master/graph/badge.svg?token=YSUU4PHM6Y)](https://codecov.io/gh/araluce/calendlyr)
4
+ [![Gem Version](https://badge.fury.io/rb/calendlyr.svg)](https://badge.fury.io/rb/calendlyr)
5
5
 
6
- # Calendly API Rubygem
6
+ # Calendly API Rubygem LITE version
7
7
 
8
8
  Easy and complete rubygem for [Calendly](https://calendly.com/). Currently supports [API v2](https://calendly.stoplight.io/docs/api-docs).
9
9
 
10
+ No dependencies, just needed a Personal Access Token.
11
+
12
+ > If you need a Oauth authentication maybe you need [calendly-api-ruby-client](https://github.com/koshilife/calendly-api-ruby-client)
13
+
10
14
  ## Installation
11
15
 
12
16
  Add this line to your application's Gemfile:
13
17
 
14
18
  ```ruby
15
- gem 'calendlyr', github: "araluce/calendly.rb"
19
+ gem 'calendlyr'
16
20
  ```
17
21
 
18
22
  And then execute:
@@ -25,10 +29,10 @@ Or install it yourself as:
25
29
 
26
30
  ## Usage
27
31
 
28
- To access the API, you'll need to create a `Calendly::Client` and pass in your API key. You can generate your Personal Access Token at [https://calendly.com/integrations/api_webhooks](https://calendly.com/integrations/api_webhooks)
32
+ To access the API, you'll need to create a `Calendlyr::Client` and pass in your token. You can generate your Personal Access Token at [https://calendly.com/integrations/api_webhooks](https://calendly.com/integrations/api_webhooks)
29
33
 
30
34
  ```ruby
31
- client = Calendly::Client.new(api_key: ENV["CALENDLY_API_KEY"])
35
+ client = Calendlyr::Client.new(token: ENV["CALENDLY_TOKEN"])
32
36
  ```
33
37
 
34
38
  The client then gives you access to each of the resources.
@@ -37,7 +41,7 @@ The client then gives you access to each of the resources.
37
41
 
38
42
  The gem maps as closely as we can to the Calendly API so you can easily convert API examples to gem code.
39
43
 
40
- Responses are created as objects like `Calendly::Event`. Having types like `Calendly::User` is handy for understanding what type of object you're working with. They're built using OpenStruct so you can easily access data in a Ruby-ish way.
44
+ Responses are created as objects like `Calendlyr::Event`. Having types like `Calendlyr::User` is handy for understanding what type of object you're working with. They're built using OpenStruct so you can easily access data in a Ruby-ish way.
41
45
 
42
46
  ##### Pagination
43
47
 
@@ -45,20 +49,20 @@ Responses are created as objects like `Calendly::Event`. Having types like `Cale
45
49
 
46
50
  ```ruby
47
51
  results = client.me.events(count: 5)
48
- #=> Calendly::Collection
52
+ #=> Calendlyr::Collection
49
53
 
50
54
  results.count
51
55
  #=> 5
52
56
 
53
57
  results.data
54
- #=> [#<Calendly::Event>, #<Calendly::Event>]
58
+ #=> [#<Calendlyr::Event>, #<Calendlyr::Event>]
55
59
 
56
60
  results.next_page_token
57
61
  #=> "KfKBetd7bS0wsFINjYky9mp8ZJXv76aL"
58
62
 
59
63
  # Retrieve the next page
60
64
  client.me.events(count: 5, next_page_token: results.next_page_token)
61
- #=> Calendly::Collection
65
+ #=> Calendlyr::Collection
62
66
  ```
63
67
 
64
68
  ### Users
@@ -68,16 +72,16 @@ client.users.me
68
72
  client.retrieve(user_uuid: "uuid")
69
73
 
70
74
  client.organization
71
- #=> #<Calendly::Organization>
75
+ #=> #<Calendlyr::Organization>
72
76
 
73
77
  client.me.event_types
74
- #=> Calendly::Collection @data=[#<Calendly::EventType>, #<Calendly::EventType>]
78
+ #=> Calendlyr::Collection @data=[#<Calendlyr::EventType>, #<Calendlyr::EventType>]
75
79
 
76
80
  client.me.events
77
- #=> Calendly::Collection @data=[#<Calendly::Event>, #<Calendly::Event>]
81
+ #=> Calendlyr::Collection @data=[#<Calendlyr::Event>, #<Calendlyr::Event>]
78
82
 
79
83
  client.me.memberships
80
- #=> Calendly::Collection @data=[#<Calendly::MemberShip>, #<Calendly::MemberShip>]
84
+ #=> Calendlyr::Collection @data=[#<Calendlyr::MemberShip>, #<Calendlyr::MemberShip>]
81
85
  ```
82
86
 
83
87
  ### Event Types
@@ -146,13 +150,13 @@ client.data_compliance.delete_invitee_data
146
150
 
147
151
  ## Contributing
148
152
 
149
- 1. Fork it ( https://github.com/araluce/calendly.rb/fork )
153
+ 1. Fork it ( https://github.com/araluce/calendlyr/fork )
150
154
  2. Create your feature branch (`git checkout -b my-new-feature`)
151
155
  3. Commit your changes (`git commit -am 'Add some feature'`)
152
156
  4. Push to the branch (`git push origin my-new-feature`)
153
157
  5. Create a new Pull Request
154
158
 
155
- When adding resources, add to the list of resources in lib/calendly.rb. Additionally, write a spec and add it to the list in the README.
159
+ When adding resources, add to the list of resources in lib/calendlyr. Additionally, write a spec and add it to the list in the README.
156
160
 
157
161
  ## Thanks
158
162
 
data/bin/console CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "calendly"
4
+ require "calendlyr"
5
5
 
6
- client = Calendly::Client.new(api_key: ENV["CALENDLY_API_KEY"])
6
+ client = Calendlyr::Client.new(token: ENV["CALENDLY_TOKEN"])
7
7
 
8
8
  puts
9
- puts "We've created a 'client' variable as a Calendly::Client using ENV['CALENDLY_API_KEY'] as the API key."
9
+ puts "We've created a 'client' variable as a Calendlyr::Client using ENV['CALENDLY_TOKEN'] as the Personal Access Token."
10
10
  puts
11
11
 
12
12
  require "irb"
@@ -1,14 +1,14 @@
1
- require "./lib/calendly/version"
1
+ require "./lib/calendlyr/version"
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "calendlyr"
5
- spec.version = Calendly::VERSION
5
+ spec.version = Calendlyr::VERSION
6
6
  spec.authors = ["araluce"]
7
7
  spec.email = ["araluce11@gmail.com"]
8
8
 
9
9
  spec.summary = "Ruby bindings for Calendly API."
10
10
  spec.description = "Ruby bindings for Calendly API. Calendly APIs can be found here: https://calendly.stoplight.io/docs/api-docs/"
11
- spec.homepage = "https://github.com/araluce/calendly.rb"
11
+ spec.homepage = "https://github.com/araluce/calendlyr"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
14
14
  spec.metadata["homepage_uri"] = spec.homepage
@@ -1,12 +1,11 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Client
3
3
  BASE_URL = "https://api.calendly.com"
4
4
 
5
- attr_reader :api_key
5
+ attr_reader :token
6
6
 
7
- def initialize(api_key:)
8
- @api_key = api_key
9
- raise Error, "Add an api_key to use Calendly. Calendly::Client.new(api_key: 'your_api_key')" unless api_key
7
+ def initialize(token:)
8
+ @token = token
10
9
  end
11
10
 
12
11
  def me
@@ -49,9 +48,9 @@ module Calendly
49
48
  DataComplianceResource.new(self)
50
49
  end
51
50
 
52
- # Avoid returning #<Calendly::Client @api_key="api_key" ...>
51
+ # Avoid returning #<Calendlyr::Client @token="token" ...>
53
52
  def inspect
54
- "#<Calendly::Client>"
53
+ "#<Calendlyr::Client>"
55
54
  end
56
55
  end
57
56
  end
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Collection
3
3
  attr_reader :data, :count, :next_page, :next_page_token, :client
4
4
 
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Error < StandardError
3
3
  end
4
4
  end
@@ -1,6 +1,6 @@
1
1
  require "ostruct"
2
2
 
3
- module Calendly
3
+ module Calendlyr
4
4
  class Object < OpenStruct
5
5
  def initialize(attributes)
6
6
  super to_ostruct(attributes.merge(uuid: extract_uuid(attributes)))
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class EventInvitee < Object
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class EventType < Object
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Event < Object
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Invitation < Object
3
3
  def associated_organization
4
4
  @associated_organization ||= Organization.new({"uri" => organization}.merge(client: client))
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Membership < Object
3
3
  def associated_user
4
4
  client.users.retrieve user_uuid: get_slug(user.uri)
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Organization < Object
3
3
  def invite_user(email:)
4
4
  client.organizations.invite organization_uuid: uuid, email: email
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class SchedulingLink < Object
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class User < Object
3
3
  def organization
4
4
  @organization ||= Organization.new({"uri" => current_organization}.merge(client: client))
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Webhook < Object
3
3
  def associated_user
4
4
  client.users.retrieve(user_uuid: get_slug(user))
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class Resource
3
3
  attr_reader :client
4
4
 
@@ -42,7 +42,7 @@ module Calendly
42
42
 
43
43
  request = req_type.new(uri)
44
44
  request["Content-Type"] = "application/json"
45
- request["Authorization"] = "Bearer #{client.api_key}"
45
+ request["Authorization"] = "Bearer #{client.token}"
46
46
  request.body = body.to_json if body.any?
47
47
 
48
48
  http.request(request)
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class DataComplianceResource < Resource
3
3
  def delete_invitee_data(emails:)
4
4
  post_request("data_compliance/deletion/invitees", body: {emails: emails})
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class EventInviteeResource < Resource
3
3
  def list(event_uuid:, **params)
4
4
  response = get_request("scheduled_events/#{event_uuid}/invitees", params: params.compact)
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class EventTypeResource < Resource
3
3
  def list(user_uri:, organization_uri:, **params)
4
4
  response = get_request("event_types", params: {user: user_uri, organization: organization_uri}.merge(params))
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class EventResource < Resource
3
3
  def list(user_uri:, organization_uri:, **params)
4
4
  response = get_request("scheduled_events", params: {user: user_uri, organization: organization_uri}.merge(params).compact)
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class OrganizationResource < Resource
3
3
  def invite(organization_uuid:, email:)
4
4
  Invitation.new post_request("organizations/#{organization_uuid}/invitations", body: {email: email}).merge(client: client)
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class SchedulingLinkResource < Resource
3
3
  def create(owner_uri:, max_event_count:, owner_type: "EventType")
4
4
  body = {owner: owner_uri, max_event_count: max_event_count, owner_type: owner_type}
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class UserResource < Resource
3
3
  def me
4
4
  retrieve(user_uuid: "me")
@@ -1,4 +1,4 @@
1
- module Calendly
1
+ module Calendlyr
2
2
  class WebhookResource < Resource
3
3
  def list(organization_uri:, scope:, **params)
4
4
  response = get_request("webhook_subscriptions", params: {organization: organization_uri, scope: scope}.merge(params).compact)
@@ -0,0 +1,3 @@
1
+ module Calendlyr
2
+ VERSION = "0.3.5"
3
+ end
data/lib/calendlyr.rb ADDED
@@ -0,0 +1,35 @@
1
+ require "net/http"
2
+ require "uri"
3
+ require "json"
4
+ require "openssl"
5
+ require "cgi"
6
+ require "calendlyr/version"
7
+
8
+ module Calendlyr
9
+ autoload :Client, "calendlyr/client"
10
+ autoload :Collection, "calendlyr/collection"
11
+ autoload :Error, "calendlyr/error"
12
+ autoload :Resource, "calendlyr/resource"
13
+ autoload :Object, "calendlyr/object"
14
+
15
+ # High-level categories of Calendly API calls
16
+ autoload :UserResource, "calendlyr/resources/users"
17
+ autoload :EventTypeResource, "calendlyr/resources/event_types"
18
+ autoload :OrganizationResource, "calendlyr/resources/organizations"
19
+ autoload :EventResource, "calendlyr/resources/events"
20
+ autoload :EventInviteeResource, "calendlyr/resources/event_invitees"
21
+ autoload :SchedulingLinkResource, "calendlyr/resources/scheduling_links"
22
+ autoload :WebhookResource, "calendlyr/resources/webhooks"
23
+ autoload :DataComplianceResource, "calendlyr/resources/data_compliance"
24
+
25
+ # Classes used to return a nicer object wrapping the response data
26
+ autoload :User, "calendlyr/objects/users"
27
+ autoload :EventType, "calendlyr/objects/event_types"
28
+ autoload :Event, "calendlyr/objects/events"
29
+ autoload :Organization, "calendlyr/objects/organizations"
30
+ autoload :Invitation, "calendlyr/objects/invitations"
31
+ autoload :EventInvitee, "calendlyr/objects/event_invitees"
32
+ autoload :SchedulingLink, "calendlyr/objects/scheduling_links"
33
+ autoload :Membership, "calendlyr/objects/memberships"
34
+ autoload :Webhook, "calendlyr/objects/webhooks"
35
+ end
@@ -0,0 +1,8 @@
1
+ require "test_helper"
2
+
3
+ class ClientTest < Minitest::Test
4
+ def test_token
5
+ client = Calendlyr::Client.new token: "test"
6
+ assert_equal "test", client.token
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ require "test_helper"
2
+
3
+ class ObjectTest < Minitest::Test
4
+ def test_creating_object_from_hash
5
+ assert_equal "bar", Calendlyr::Object.new(foo: "bar").foo
6
+ end
7
+
8
+ def test_nested_hash
9
+ assert_equal "foobar", Calendlyr::Object.new(foo: {bar: {baz: "foobar"}}, client: nil).foo.bar.baz
10
+ end
11
+
12
+ def test_nested_number
13
+ assert_equal 1, Calendlyr::Object.new(foo: {bar: 1}, client: nil).foo.bar
14
+ end
15
+
16
+ def test_array
17
+ object = Calendlyr::Object.new(foo: [{bar: :baz}], client: nil)
18
+ assert_equal OpenStruct, object.foo.first.class
19
+ assert_equal :baz, object.foo.first.bar
20
+ end
21
+ end
@@ -9,8 +9,8 @@ class EventInviteesResourceTest < Minitest::Test
9
9
  stub(path: "scheduled_events/#{event_uuid}/invitees", response: response)
10
10
  event_invitees = client.event_invitees.list(event_uuid: event_uuid)
11
11
 
12
- assert_equal Calendly::Collection, event_invitees.class
13
- assert_equal Calendly::EventInvitee, event_invitees.data.first.class
12
+ assert_equal Calendlyr::Collection, event_invitees.class
13
+ assert_equal Calendlyr::EventInvitee, event_invitees.data.first.class
14
14
  assert_equal 1, event_invitees.count
15
15
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", event_invitees.next_page_token
16
16
  end
@@ -22,7 +22,7 @@ class EventInviteesResourceTest < Minitest::Test
22
22
  stub(path: "scheduled_events/#{event_uuid}/invitees/#{invitee_uuid}", response: response)
23
23
  event_invitee = client.event_invitees.retrieve(event_uuid: event_uuid, invitee_uuid: invitee_uuid)
24
24
 
25
- assert_equal Calendly::EventInvitee, event_invitee.class
25
+ assert_equal Calendlyr::EventInvitee, event_invitee.class
26
26
  assert_equal "https://api.calendly.com/api/v2/scheduled_events/ABCDABCDABCDABCD/invitees/ABCDABCDABCDABCD", event_invitee.uri
27
27
  assert_equal "John Doe", event_invitee.name
28
28
  end
@@ -10,8 +10,8 @@ class EventTypesResourceTest < Minitest::Test
10
10
  stub(path: "event_types?user=#{user_uri}&organization=#{organization_uri}", response: response)
11
11
  event_types = client.event_types.list(user_uri: user_uri, organization_uri: organization_uri)
12
12
 
13
- assert_equal Calendly::Collection, event_types.class
14
- assert_equal Calendly::EventType, event_types.data.first.class
13
+ assert_equal Calendlyr::Collection, event_types.class
14
+ assert_equal Calendlyr::EventType, event_types.data.first.class
15
15
  assert_equal 1, event_types.count
16
16
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", event_types.next_page_token
17
17
  end
@@ -22,7 +22,7 @@ class EventTypesResourceTest < Minitest::Test
22
22
  stub(path: "event_types/#{event_type_uuid}", response: response)
23
23
  event_type = client.event_types.retrieve(event_type_uuid: event_type_uuid)
24
24
 
25
- assert_equal Calendly::EventType, event_type.class
25
+ assert_equal Calendlyr::EventType, event_type.class
26
26
  assert_equal "https://api.calendly.com/event_types/AAAAAAAAAAAAAAAA", event_type.uri
27
27
  assert_equal "15 Minute Meeting", event_type.name
28
28
  assert_equal "acmesales", event_type.slug
@@ -10,8 +10,8 @@ class EventsResourceTest < Minitest::Test
10
10
  stub(path: "scheduled_events?user=#{user_uri}&organization=#{organization_uri}", response: response)
11
11
  events = client.events.list(user_uri: user_uri, organization_uri: organization_uri)
12
12
 
13
- assert_equal Calendly::Collection, events.class
14
- assert_equal Calendly::Event, events.data.first.class
13
+ assert_equal Calendlyr::Collection, events.class
14
+ assert_equal Calendlyr::Event, events.data.first.class
15
15
  assert_equal 1, events.count
16
16
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", events.next_page_token
17
17
  end
@@ -22,7 +22,7 @@ class EventsResourceTest < Minitest::Test
22
22
  stub(path: "scheduled_events/#{event_uuid}", response: response)
23
23
  event = client.events.retrieve(event_uuid: event_uuid)
24
24
 
25
- assert_equal Calendly::Event, event.class
25
+ assert_equal Calendlyr::Event, event.class
26
26
  assert_equal "https://api.calendly.com/scheduled_events/GBGBDCAADAEDCRZ2", event.uri
27
27
  assert_equal "15 Minute Meeting", event.name
28
28
  end
@@ -11,7 +11,7 @@ class OrganizationsResourceTest < Minitest::Test
11
11
 
12
12
  invitation = client.organizations.invite(organization_uuid: organization_uuid, email: email)
13
13
 
14
- assert_equal Calendly::Invitation, invitation.class
14
+ assert_equal Calendlyr::Invitation, invitation.class
15
15
  assert_equal email, invitation.email
16
16
  end
17
17
 
@@ -21,8 +21,8 @@ class OrganizationsResourceTest < Minitest::Test
21
21
  stub(path: "organizations/#{organization_uuid}/invitations", response: response)
22
22
  invitations = client.organizations.list_invitations(organization_uuid: organization_uuid)
23
23
 
24
- assert_equal Calendly::Collection, invitations.class
25
- assert_equal Calendly::Invitation, invitations.data.first.class
24
+ assert_equal Calendlyr::Collection, invitations.class
25
+ assert_equal Calendlyr::Invitation, invitations.data.first.class
26
26
  assert_equal 1, invitations.count
27
27
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", invitations.next_page_token
28
28
  end
@@ -34,8 +34,8 @@ class OrganizationsResourceTest < Minitest::Test
34
34
  stub(path: "organization_memberships?user=#{user_uri}&organization=#{organization_uri}", response: response)
35
35
  memberships = client.organizations.list_memberships(user_uri: user_uri, organization_uri: organization_uri)
36
36
 
37
- assert_equal Calendly::Collection, memberships.class
38
- assert_equal Calendly::Membership, memberships.data.first.class
37
+ assert_equal Calendlyr::Collection, memberships.class
38
+ assert_equal Calendlyr::Membership, memberships.data.first.class
39
39
  assert_equal 1, memberships.count
40
40
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", memberships.next_page_token
41
41
  end
@@ -47,7 +47,7 @@ class OrganizationsResourceTest < Minitest::Test
47
47
  stub(path: "organizations/#{organization_uuid}/invitations/#{invitation_uuid}", response: response)
48
48
  invitation = client.organizations.retrieve_invitation(organization_uuid: organization_uuid, invitation_uuid: invitation_uuid)
49
49
 
50
- assert_equal Calendly::Invitation, invitation.class
50
+ assert_equal Calendlyr::Invitation, invitation.class
51
51
  assert_equal "test@example.com", invitation.email
52
52
  end
53
53
 
@@ -57,7 +57,7 @@ class OrganizationsResourceTest < Minitest::Test
57
57
  stub(path: "organization_memberships/#{membership_uuid}", response: response)
58
58
  membership = client.organizations.retrieve_membership(membership_uuid: membership_uuid)
59
59
 
60
- assert_equal Calendly::Membership, membership.class
60
+ assert_equal Calendlyr::Membership, membership.class
61
61
  assert_equal "test@example.com", membership.user.email
62
62
  end
63
63
 
@@ -85,7 +85,7 @@ class OrganizationsResourceTest < Minitest::Test
85
85
 
86
86
  invitation = client.organization.invite_user(email: email)
87
87
 
88
- assert_equal Calendly::Invitation, invitation.class
88
+ assert_equal Calendlyr::Invitation, invitation.class
89
89
  assert_equal email, invitation.email
90
90
  end
91
91
 
@@ -94,8 +94,8 @@ class OrganizationsResourceTest < Minitest::Test
94
94
  stub(path: "organizations/#{client.organization.uuid}/invitations", response: {body: fixture_file("organizations/list_invitations"), status: 200})
95
95
  invitations = client.organization.list_invitations
96
96
 
97
- assert_equal Calendly::Collection, invitations.class
98
- assert_equal Calendly::Invitation, invitations.data.first.class
97
+ assert_equal Calendlyr::Collection, invitations.class
98
+ assert_equal Calendlyr::Invitation, invitations.data.first.class
99
99
  assert_equal 1, invitations.count
100
100
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", invitations.next_page_token
101
101
  end
@@ -112,7 +112,7 @@ class OrganizationsResourceTest < Minitest::Test
112
112
  stub(path: "organizations/#{client.organization.uuid}/invitations/AAAAAAAAAAAAAAAA", response: response)
113
113
  invitation = client.organization.invitation(invitation_uuid: "AAAAAAAAAAAAAAAA")
114
114
 
115
- assert_equal Calendly::Invitation, invitation.class
115
+ assert_equal Calendlyr::Invitation, invitation.class
116
116
  assert_equal "test@example.com", invitation.email
117
117
  end
118
118
 
@@ -121,8 +121,8 @@ class OrganizationsResourceTest < Minitest::Test
121
121
  stub(path: "scheduled_events?organization=#{client.organization.uri}", response: {body: fixture_file("events/list"), status: 200})
122
122
  events = client.organization.events
123
123
 
124
- assert_equal Calendly::Collection, events.class
125
- assert_equal Calendly::Event, events.data.first.class
124
+ assert_equal Calendlyr::Collection, events.class
125
+ assert_equal Calendlyr::Event, events.data.first.class
126
126
  assert_equal 1, events.count
127
127
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", events.next_page_token
128
128
  end
@@ -132,8 +132,8 @@ class OrganizationsResourceTest < Minitest::Test
132
132
  stub(path: "organization_memberships?organization=#{client.organization.uri}", response: {body: fixture_file("organizations/list_memberships"), status: 200})
133
133
  memberships = client.organization.memberships
134
134
 
135
- assert_equal Calendly::Collection, memberships.class
136
- assert_equal Calendly::Membership, memberships.data.first.class
135
+ assert_equal Calendlyr::Collection, memberships.class
136
+ assert_equal Calendlyr::Membership, memberships.data.first.class
137
137
  assert_equal 1, memberships.count
138
138
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", memberships.next_page_token
139
139
  end
@@ -9,7 +9,7 @@ class UsersResourceTest < Minitest::Test
9
9
  stub(path: "users/#{user_uuid}", response: response)
10
10
  user = client.users.retrieve(user_uuid: user_uuid)
11
11
 
12
- assert_equal Calendly::User, user.class
12
+ assert_equal Calendlyr::User, user.class
13
13
  assert_equal "https://api.calendly.com/users/AAAAAAAAAAAAAAAA", user.uri
14
14
  assert_equal "John Doe", user.name
15
15
  assert_equal "acmesales", user.slug
@@ -21,7 +21,7 @@ class UsersResourceTest < Minitest::Test
21
21
  stub(path: "users/me", response: response)
22
22
  me = client.me
23
23
 
24
- assert_equal Calendly::User, me.class
24
+ assert_equal Calendlyr::User, me.class
25
25
  assert_equal "https://api.calendly.com/users/AAAAAAAAAAAAAAAA", me.uri
26
26
  assert_equal "John Doe", me.name
27
27
  assert_equal "acmesales", me.slug
@@ -33,7 +33,7 @@ class UsersResourceTest < Minitest::Test
33
33
  stub(path: "users/me", response: response)
34
34
  organization = client.organization
35
35
 
36
- assert_equal Calendly::Organization, organization.class
36
+ assert_equal Calendlyr::Organization, organization.class
37
37
  assert_equal "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA", organization.uri
38
38
  assert_equal "AAAAAAAAAAAAAAAA", organization.uuid
39
39
  end
@@ -45,8 +45,8 @@ class UsersResourceTest < Minitest::Test
45
45
  stub(path: "event_types?user=#{me.uri}&organization=#{me.organization.uri}", response: {body: fixture_file("event_types/list"), status: 200})
46
46
  event_types = client.me.event_types
47
47
 
48
- assert_equal Calendly::Collection, event_types.class
49
- assert_equal Calendly::EventType, event_types.data.first.class
48
+ assert_equal Calendlyr::Collection, event_types.class
49
+ assert_equal Calendlyr::EventType, event_types.data.first.class
50
50
  assert_equal 1, event_types.count
51
51
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", event_types.next_page_token
52
52
  end
@@ -58,8 +58,8 @@ class UsersResourceTest < Minitest::Test
58
58
  stub(path: "scheduled_events?user=#{me.uri}&organization=#{me.organization.uri}", response: {body: fixture_file("events/list"), status: 200})
59
59
  events = client.me.events
60
60
 
61
- assert_equal Calendly::Collection, events.class
62
- assert_equal Calendly::Event, events.data.first.class
61
+ assert_equal Calendlyr::Collection, events.class
62
+ assert_equal Calendlyr::Event, events.data.first.class
63
63
  assert_equal 1, events.count
64
64
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", events.next_page_token
65
65
  end
@@ -71,8 +71,8 @@ class UsersResourceTest < Minitest::Test
71
71
  stub(path: "organization_memberships?user=#{me.uri}&organization=#{me.organization.uri}", response: {body: fixture_file("organizations/list_memberships"), status: 200})
72
72
  memberships = client.me.memberships(organization_uri: me.organization.uri)
73
73
 
74
- assert_equal Calendly::Collection, memberships.class
75
- assert_equal Calendly::Membership, memberships.data.first.class
74
+ assert_equal Calendlyr::Collection, memberships.class
75
+ assert_equal Calendlyr::Membership, memberships.data.first.class
76
76
  assert_equal 1, memberships.count
77
77
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", memberships.next_page_token
78
78
  end
@@ -10,8 +10,8 @@ class WebhooksResourceTest < Minitest::Test
10
10
  stub(path: "webhook_subscriptions?organization=#{organization_uri}&scope=#{scope}", response: response)
11
11
  webhooks = client.webhooks.list(organization_uri: organization_uri, scope: scope)
12
12
 
13
- assert_equal Calendly::Collection, webhooks.class
14
- assert_equal Calendly::Webhook, webhooks.data.first.class
13
+ assert_equal Calendlyr::Collection, webhooks.class
14
+ assert_equal Calendlyr::Webhook, webhooks.data.first.class
15
15
  assert_equal 1, webhooks.count
16
16
  assert_equal "sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi", webhooks.next_page_token
17
17
  end
@@ -29,7 +29,7 @@ class WebhooksResourceTest < Minitest::Test
29
29
  stub(path: "webhook_subscriptions/#{webhook_uuid}", response: response)
30
30
  webhook = client.webhooks.retrieve(webhook_uuid: webhook_uuid)
31
31
 
32
- assert_equal Calendly::Webhook, webhook.class
32
+ assert_equal Calendlyr::Webhook, webhook.class
33
33
  assert_equal "user", webhook.scope
34
34
  end
35
35
 
@@ -1,7 +1,7 @@
1
1
  require "test_helper"
2
2
 
3
- class CalendlyTest < Minitest::Test
3
+ class CalendlyrTest < Minitest::Test
4
4
  def test_that_it_has_a_version_number
5
- refute_nil ::Calendly::VERSION
5
+ refute_nil ::Calendlyr::VERSION
6
6
  end
7
7
  end
data/test/test_helper.rb CHANGED
@@ -6,13 +6,13 @@ if ENV["CI"] == "true"
6
6
  require "codecov"
7
7
  SimpleCov.formatter = SimpleCov::Formatter::Codecov
8
8
  end
9
- require "calendly"
9
+ require "calendlyr"
10
10
  require "minitest/autorun"
11
11
  require "webmock/minitest"
12
12
 
13
13
  class Minitest::Test
14
14
  def client
15
- Calendly::Client.new(api_key: "fake")
15
+ Calendlyr::Client.new(token: "fake")
16
16
  end
17
17
 
18
18
  def fixture_file(fixture)
@@ -20,7 +20,7 @@ class Minitest::Test
20
20
  end
21
21
 
22
22
  def stub(path:, method: :get, body: {}, response: {})
23
- stub_req = stub_request(method, "#{Calendly::Client::BASE_URL}/#{path}")
23
+ stub_req = stub_request(method, "#{Calendlyr::Client::BASE_URL}/#{path}")
24
24
  stub_req.with(body: body) if [:post, :put, :patch].include?(method)
25
25
  stub_req.to_return(**response)
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calendlyr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - araluce
@@ -114,42 +114,42 @@ files:
114
114
  - bin/console
115
115
  - bin/setup
116
116
  - bin/test
117
- - calendly.gemspec
118
- - lib/calendly.rb
119
- - lib/calendly/client.rb
120
- - lib/calendly/collection.rb
121
- - lib/calendly/error.rb
122
- - lib/calendly/object.rb
123
- - lib/calendly/objects/event_invitees.rb
124
- - lib/calendly/objects/event_types.rb
125
- - lib/calendly/objects/events.rb
126
- - lib/calendly/objects/invitations.rb
127
- - lib/calendly/objects/memberships.rb
128
- - lib/calendly/objects/organizations.rb
129
- - lib/calendly/objects/scheduling_links.rb
130
- - lib/calendly/objects/users.rb
131
- - lib/calendly/objects/webhooks.rb
132
- - lib/calendly/resource.rb
133
- - lib/calendly/resources/data_compliance.rb
134
- - lib/calendly/resources/event_invitees.rb
135
- - lib/calendly/resources/event_types.rb
136
- - lib/calendly/resources/events.rb
137
- - lib/calendly/resources/organizations.rb
138
- - lib/calendly/resources/scheduling_links.rb
139
- - lib/calendly/resources/users.rb
140
- - lib/calendly/resources/webhooks.rb
141
- - lib/calendly/version.rb
142
- - test/calendly/client_test.rb
143
- - test/calendly/object_test.rb
144
- - test/calendly/resources/data_compliance.rb
145
- - test/calendly/resources/event_invitees_test.rb
146
- - test/calendly/resources/event_types_test.rb
147
- - test/calendly/resources/events_test.rb
148
- - test/calendly/resources/organizations_test.rb
149
- - test/calendly/resources/scheduling_links.rb
150
- - test/calendly/resources/users_test.rb
151
- - test/calendly/resources/webhooks_test.rb
152
- - test/calendly_test.rb
117
+ - calendlyr.gemspec
118
+ - lib/calendlyr.rb
119
+ - lib/calendlyr/client.rb
120
+ - lib/calendlyr/collection.rb
121
+ - lib/calendlyr/error.rb
122
+ - lib/calendlyr/object.rb
123
+ - lib/calendlyr/objects/event_invitees.rb
124
+ - lib/calendlyr/objects/event_types.rb
125
+ - lib/calendlyr/objects/events.rb
126
+ - lib/calendlyr/objects/invitations.rb
127
+ - lib/calendlyr/objects/memberships.rb
128
+ - lib/calendlyr/objects/organizations.rb
129
+ - lib/calendlyr/objects/scheduling_links.rb
130
+ - lib/calendlyr/objects/users.rb
131
+ - lib/calendlyr/objects/webhooks.rb
132
+ - lib/calendlyr/resource.rb
133
+ - lib/calendlyr/resources/data_compliance.rb
134
+ - lib/calendlyr/resources/event_invitees.rb
135
+ - lib/calendlyr/resources/event_types.rb
136
+ - lib/calendlyr/resources/events.rb
137
+ - lib/calendlyr/resources/organizations.rb
138
+ - lib/calendlyr/resources/scheduling_links.rb
139
+ - lib/calendlyr/resources/users.rb
140
+ - lib/calendlyr/resources/webhooks.rb
141
+ - lib/calendlyr/version.rb
142
+ - test/calendlyr/client_test.rb
143
+ - test/calendlyr/object_test.rb
144
+ - test/calendlyr/resources/data_compliance.rb
145
+ - test/calendlyr/resources/event_invitees_test.rb
146
+ - test/calendlyr/resources/event_types_test.rb
147
+ - test/calendlyr/resources/events_test.rb
148
+ - test/calendlyr/resources/organizations_test.rb
149
+ - test/calendlyr/resources/scheduling_links.rb
150
+ - test/calendlyr/resources/users_test.rb
151
+ - test/calendlyr/resources/webhooks_test.rb
152
+ - test/calendlyr_test.rb
153
153
  - test/fixtures/data_compliance/delete_invitee_data.json
154
154
  - test/fixtures/event_invitees/list.json
155
155
  - test/fixtures/event_invitees/retrieve.json
@@ -171,11 +171,11 @@ files:
171
171
  - test/fixtures/webhooks/list.json
172
172
  - test/fixtures/webhooks/retrieve.json
173
173
  - test/test_helper.rb
174
- homepage: https://github.com/araluce/calendly.rb
174
+ homepage: https://github.com/araluce/calendlyr
175
175
  licenses:
176
176
  - MIT
177
177
  metadata:
178
- homepage_uri: https://github.com/araluce/calendly.rb
178
+ homepage_uri: https://github.com/araluce/calendlyr
179
179
  post_install_message:
180
180
  rdoc_options: []
181
181
  require_paths:
@@ -196,17 +196,17 @@ signing_key:
196
196
  specification_version: 4
197
197
  summary: Ruby bindings for Calendly API.
198
198
  test_files:
199
- - test/calendly/client_test.rb
200
- - test/calendly/object_test.rb
201
- - test/calendly/resources/data_compliance.rb
202
- - test/calendly/resources/event_invitees_test.rb
203
- - test/calendly/resources/event_types_test.rb
204
- - test/calendly/resources/events_test.rb
205
- - test/calendly/resources/organizations_test.rb
206
- - test/calendly/resources/scheduling_links.rb
207
- - test/calendly/resources/users_test.rb
208
- - test/calendly/resources/webhooks_test.rb
209
- - test/calendly_test.rb
199
+ - test/calendlyr/client_test.rb
200
+ - test/calendlyr/object_test.rb
201
+ - test/calendlyr/resources/data_compliance.rb
202
+ - test/calendlyr/resources/event_invitees_test.rb
203
+ - test/calendlyr/resources/event_types_test.rb
204
+ - test/calendlyr/resources/events_test.rb
205
+ - test/calendlyr/resources/organizations_test.rb
206
+ - test/calendlyr/resources/scheduling_links.rb
207
+ - test/calendlyr/resources/users_test.rb
208
+ - test/calendlyr/resources/webhooks_test.rb
209
+ - test/calendlyr_test.rb
210
210
  - test/fixtures/data_compliance/delete_invitee_data.json
211
211
  - test/fixtures/event_invitees/list.json
212
212
  - test/fixtures/event_invitees/retrieve.json
@@ -1,3 +0,0 @@
1
- module Calendly
2
- VERSION = "0.3.3"
3
- end
data/lib/calendly.rb DELETED
@@ -1,35 +0,0 @@
1
- require "net/http"
2
- require "uri"
3
- require "json"
4
- require "openssl"
5
- require "cgi"
6
- require "calendly/version"
7
-
8
- module Calendly
9
- autoload :Client, "calendly/client"
10
- autoload :Collection, "calendly/collection"
11
- autoload :Error, "calendly/error"
12
- autoload :Resource, "calendly/resource"
13
- autoload :Object, "calendly/object"
14
-
15
- # High-level categories of Calendly API calls
16
- autoload :UserResource, "calendly/resources/users"
17
- autoload :EventTypeResource, "calendly/resources/event_types"
18
- autoload :OrganizationResource, "calendly/resources/organizations"
19
- autoload :EventResource, "calendly/resources/events"
20
- autoload :EventInviteeResource, "calendly/resources/event_invitees"
21
- autoload :SchedulingLinkResource, "calendly/resources/scheduling_links"
22
- autoload :WebhookResource, "calendly/resources/webhooks"
23
- autoload :DataComplianceResource, "calendly/resources/data_compliance"
24
-
25
- # Classes used to return a nicer object wrapping the response data
26
- autoload :User, "calendly/objects/users"
27
- autoload :EventType, "calendly/objects/event_types"
28
- autoload :Event, "calendly/objects/events"
29
- autoload :Organization, "calendly/objects/organizations"
30
- autoload :Invitation, "calendly/objects/invitations"
31
- autoload :EventInvitee, "calendly/objects/event_invitees"
32
- autoload :SchedulingLink, "calendly/objects/scheduling_links"
33
- autoload :Membership, "calendly/objects/memberships"
34
- autoload :Webhook, "calendly/objects/webhooks"
35
- end
@@ -1,8 +0,0 @@
1
- require "test_helper"
2
-
3
- class ClientTest < Minitest::Test
4
- def test_api_key
5
- client = Calendly::Client.new api_key: "test"
6
- assert_equal "test", client.api_key
7
- end
8
- end
@@ -1,21 +0,0 @@
1
- require "test_helper"
2
-
3
- class ObjectTest < Minitest::Test
4
- def test_creating_object_from_hash
5
- assert_equal "bar", Calendly::Object.new(foo: "bar").foo
6
- end
7
-
8
- def test_nested_hash
9
- assert_equal "foobar", Calendly::Object.new(foo: {bar: {baz: "foobar"}}, client: nil).foo.bar.baz
10
- end
11
-
12
- def test_nested_number
13
- assert_equal 1, Calendly::Object.new(foo: {bar: 1}, client: nil).foo.bar
14
- end
15
-
16
- def test_array
17
- object = Calendly::Object.new(foo: [{bar: :baz}], client: nil)
18
- assert_equal OpenStruct, object.foo.first.class
19
- assert_equal :baz, object.foo.first.bar
20
- end
21
- end