workos 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -2
  3. data/Gemfile.lock +6 -2
  4. data/README.md +179 -8
  5. data/bin/docs +2 -2
  6. data/codecov.yml +1 -0
  7. data/docs/WorkOS.html +22 -26
  8. data/docs/WorkOS/APIError.html +160 -0
  9. data/docs/WorkOS/AuditLog.html +235 -0
  10. data/docs/WorkOS/AuthenticationError.html +160 -0
  11. data/docs/WorkOS/Base.html +27 -32
  12. data/docs/WorkOS/Client.html +493 -0
  13. data/docs/WorkOS/InvalidRequestError.html +160 -0
  14. data/docs/WorkOS/Profile.html +80 -17
  15. data/docs/WorkOS/RequestError.html +6 -6
  16. data/docs/WorkOS/SSO.html +118 -74
  17. data/docs/WorkOS/Types.html +9 -10
  18. data/docs/WorkOS/Types/ProfileStruct.html +6 -6
  19. data/docs/WorkOS/Types/Provider.html +135 -0
  20. data/docs/WorkOS/WorkOSError.html +447 -0
  21. data/docs/class_list.html +3 -3
  22. data/docs/css/style.css +2 -2
  23. data/docs/file.README.html +173 -13
  24. data/docs/file_list.html +2 -2
  25. data/docs/frames.html +2 -2
  26. data/docs/index.html +77 -16
  27. data/docs/js/app.js +14 -3
  28. data/docs/method_list.html +96 -8
  29. data/docs/top-level-namespace.html +6 -6
  30. data/lib/workos.rb +7 -2
  31. data/lib/workos/audit_log.rb +78 -0
  32. data/lib/workos/base.rb +5 -6
  33. data/lib/workos/client.rb +86 -0
  34. data/lib/workos/errors.rb +48 -0
  35. data/lib/workos/sso.rb +49 -27
  36. data/lib/workos/types.rb +2 -1
  37. data/lib/workos/types/provider_enum.rb +14 -0
  38. data/lib/workos/version.rb +2 -2
  39. data/sorbet/rbi/hidden-definitions/errors.txt +22108 -4368
  40. data/sorbet/rbi/hidden-definitions/hidden.rbi +32490 -6059
  41. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +1 -1
  42. data/sorbet/rbi/todo.rbi +5 -0
  43. data/spec/lib/workos/audit_log_spec.rb +140 -0
  44. data/spec/lib/workos/base_spec.rb +30 -0
  45. data/spec/lib/workos/sso_spec.rb +131 -36
  46. data/spec/spec_helper.rb +21 -1
  47. data/spec/support/fixtures/vcr_cassettes/audit_log/create_event.yml +65 -0
  48. data/spec/support/fixtures/vcr_cassettes/audit_log/create_event_custom_idempotency_key.yml +67 -0
  49. data/spec/support/fixtures/vcr_cassettes/audit_log/create_event_invalid.yml +68 -0
  50. data/spec/support/fixtures/vcr_cassettes/audit_log/create_events_duplicate_idempotency_key_and_payload.yml +131 -0
  51. data/spec/support/fixtures/vcr_cassettes/audit_log/create_events_duplicate_idempotency_key_different_payload.yml +134 -0
  52. data/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +66 -0
  53. data/workos.gemspec +2 -0
  54. metadata +57 -27
  55. data/lib/workos/request_error.rb +0 -5
  56. data/sorbet/rbi/gems/addressable.rbi +0 -198
  57. data/sorbet/rbi/gems/ast.rbi +0 -47
  58. data/sorbet/rbi/gems/codecov.rbi +0 -19
  59. data/sorbet/rbi/gems/crack.rbi +0 -47
  60. data/sorbet/rbi/gems/docile.rbi +0 -31
  61. data/sorbet/rbi/gems/hashdiff.rbi +0 -65
  62. data/sorbet/rbi/gems/jaro_winkler.rbi +0 -14
  63. data/sorbet/rbi/gems/parallel.rbi +0 -81
  64. data/sorbet/rbi/gems/parser.rbi +0 -856
  65. data/sorbet/rbi/gems/public_suffix.rbi +0 -102
  66. data/sorbet/rbi/gems/rack.rbi +0 -103
  67. data/sorbet/rbi/gems/rainbow.rbi +0 -117
  68. data/sorbet/rbi/gems/rake.rbi +0 -632
  69. data/sorbet/rbi/gems/rspec-core.rbi +0 -1661
  70. data/sorbet/rbi/gems/rspec-expectations.rbi +0 -388
  71. data/sorbet/rbi/gems/rspec-mocks.rbi +0 -823
  72. data/sorbet/rbi/gems/rspec-support.rbi +0 -266
  73. data/sorbet/rbi/gems/rspec.rbi +0 -14
  74. data/sorbet/rbi/gems/rubocop.rbi +0 -7083
  75. data/sorbet/rbi/gems/ruby-progressbar.rbi +0 -304
  76. data/sorbet/rbi/gems/simplecov-html.rbi +0 -30
  77. data/sorbet/rbi/gems/simplecov.rbi +0 -225
  78. data/sorbet/rbi/gems/unicode-display_width.rbi +0 -16
  79. data/sorbet/rbi/gems/webmock.rbi +0 -526
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4a148a2a3c606738d27e79bcaf6c599ed6dcbfe28f89fbfd19e49fa06616c02
4
- data.tar.gz: 298806d027c6dd44d45a73f58c25fe8ac046de1e846f9cfe552e3ef4a1ea4b75
3
+ metadata.gz: 70741b6fe93402cbd090a16e41cf7ea2cb6df08073f1bdb95c0fc8ab06f7e5b5
4
+ data.tar.gz: 0a2726acf7ca96b490c4c66585dd3cf9ad0f70f89ec00991d69460ec8ec4907d
5
5
  SHA512:
6
- metadata.gz: 91a635da667d2c6b84148df8c27667249e5e68888120837e934aff39b2a9c1df14f5c090b2755e5f1686cb26b549c9b5092570c193ff9055c9ef902f04325e7d
7
- data.tar.gz: bddb0eaf54cbe9d95a9ffbe20ffa1ed8ba729aae5e0c5eeff7b1c86913ed8989cd7411ce30f44f4d9d499d8b6a576bb224e00beb4d1920700926d7143c08ed30
6
+ metadata.gz: 2d3d401843a2d5a19adf7a1ebb9e6c8cdf49228702cd93bf82fe5c2cb368ad9770bffe0a567d9e2e94772df4dad4ecbb2f594a37de9ddba3f8334648a270ec9e
7
+ data.tar.gz: a0a7f900ad0d0a60ccfb3aa8f5ac20e2f19dd0577cd27d9ecde782b4740ad50ef4bc2fbc326bca03fa7b7a55950bdfc73ef91db59c05904097ee753b79e09f59
@@ -3,11 +3,14 @@ Layout/DotPosition:
3
3
  Layout/EmptyLineAfterMagicComment:
4
4
  Enabled: false
5
5
  Layout/EmptyLines:
6
- Enabled: false
6
+ Enabled: false
7
+ Layout/LineLength:
8
+ IgnoredPatterns:
9
+ - 'VCR\.use_cassette'
10
+ - '(\A|\s)/.*?/'
7
11
  Metrics/BlockLength:
8
12
  ExcludedMethods: ['describe', 'context']
9
13
  Style/TrailingCommaInArguments:
10
14
  EnforcedStyleForMultiline: 'consistent_comma'
11
15
  Style/TrailingCommaInHashLiteral:
12
16
  EnforcedStyleForMultiline: 'consistent_comma'
13
-
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (0.0.2)
4
+ workos (0.1.0)
5
5
  sorbet-runtime (~> 0.5)
6
6
 
7
7
  GEM
@@ -56,14 +56,16 @@ GEM
56
56
  simplecov-html (0.10.2)
57
57
  sorbet (0.5.5181)
58
58
  sorbet-static (= 0.5.5181)
59
- sorbet-runtime (0.5.5181)
59
+ sorbet-runtime (0.5.5182)
60
60
  sorbet-static (0.5.5181-universal-darwin-14)
61
61
  unicode-display_width (1.6.0)
62
62
  url (0.3.2)
63
+ vcr (5.0.0)
63
64
  webmock (3.7.6)
64
65
  addressable (>= 2.3.6)
65
66
  crack (>= 0.3.2)
66
67
  hashdiff (>= 0.4.0, < 2.0.0)
68
+ yard (0.9.22)
67
69
 
68
70
  PLATFORMS
69
71
  ruby
@@ -75,8 +77,10 @@ DEPENDENCIES
75
77
  rspec (~> 3.9.0)
76
78
  rubocop (~> 0.77)
77
79
  sorbet (~> 0.5)
80
+ vcr (~> 5.0.0)
78
81
  webmock
79
82
  workos!
83
+ yard
80
84
 
81
85
  BUNDLED WITH
82
86
  2.1.2
data/README.md CHANGED
@@ -1,21 +1,192 @@
1
- # workos-rb
1
+ # workos-ruby [![codecov](https://codecov.io/gh/workos-inc/workos-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/workos-inc/workos-ruby)
2
+
2
3
  WorkOS official Ruby gem for interacting with WorkOS APIs
3
4
 
5
+ ## Documentation
6
+
7
+ Complete documentation for the latest version of WorkOS Ruby Gem can be found [here](https://workos-inc.github.io/workos-ruby/).
8
+
4
9
  ## Installation
5
10
 
6
- You don't need this source code unless you want to modify the gem. If you just
7
- want to use the package, just run:
11
+ To get started, you can install the WorkOS gem via RubyGems with:
8
12
 
9
- ```sh
13
+ ```ruby
10
14
  gem install workos
11
15
  ```
12
16
 
13
- If you want to build the gem from source:
17
+ If you're using Bundler to manage your application's gems, add the WorkOS gem to your Gemfile:
18
+
19
+ ```ruby
20
+ source 'https://rubygems.org'
21
+
22
+ gem 'workos'
23
+ ```
24
+
25
+ ## Configuration
26
+
27
+ To use the SDK you must first provide your API key from the [WorkOS Developer Dashboard](https://dashboard.workos.com/api-keys).
28
+
29
+ You can do this through the `WORKOS_KEY` environment variable or by calling `WorkOS.key = [your API key]`.
30
+
31
+ The WorkOS Gem will read the environment variable `WORKOS_KEY`:
14
32
 
15
33
  ```sh
16
- gem build workos.gemspec
34
+ $ WORKOS_KEY=[your api key] ruby app.rb
35
+ ```
36
+
37
+ Alternatively, you may set the key yourself, such as in an initializer in your application load path:
38
+
39
+ ```ruby
40
+ # /config/initializers/workos.rb
41
+
42
+ WorkOS.key = '[your api key]'
43
+ ```
44
+
45
+ ## The Audit Log Module
46
+
47
+ The Audit Log Module provides methods for creating Audit Log events on
48
+ WorkOS.
49
+
50
+ See our [Audit Log
51
+ Quickstart](https://dashboard.workos.com/docs/audit-log/quickstart) for
52
+ more information.
53
+
54
+ ```ruby
55
+ payload = {
56
+ group: 'Foo Corp',
57
+ location: '127.0.0.1',
58
+ action: 'user.created',
59
+ action_type: 'C',
60
+ actor_name: 'Foo',
61
+ actor_id: 'user_12345',
62
+ target_name: 'Bar',
63
+ target_id: 'user_67890',
64
+ occurred_at: '2020-01-10T15:30:00-05:00',
65
+ metadata: {
66
+ source: 'Email',
67
+ }
68
+ }
69
+
70
+ WorkOS::AuditLog.create_event(event: payload)
71
+ ```
72
+
73
+ ### Idempotency
74
+
75
+ To perform an idempotent request, provide an additional idempotency_key
76
+ parameter to the `create_event` options.
77
+
78
+ ```ruby
79
+ WorkOS::AuditLog.create_event(event: payload, idempotency_key: 'key123456')
80
+ ```
81
+
82
+ See our [API
83
+ Reference](https://dashboard.workos.com/docs/api-reference#idempotency)
84
+ for more information on idempotency keys.
85
+
86
+ ## The SSO Module
87
+
88
+ The SSO Module provides convenience methods for authenticating a Single Sign On (SSO) user via WorkOS. WorkOS SSO follows the Oauth 2.0 specification.
89
+
90
+ First, you'll direct your SSO users to an `authorization_url`. They will sign in to their SSO account with their Identity Provider, and be redirected to a
91
+ callback URL that you set in your WorkOS Dashboard. The user will be redirected with a `code` URL parameter, which you can then exchange for a WorkOS::Profile
92
+ using the `WorkOS::SSO.get_profile` method.
93
+
94
+ See our Ruby SSO example app for a [complete example](https://github.com/workos-inc/ruby-sso-example).
95
+
96
+ ```ruby
97
+ WorkOS::SSO.authorization_url(domain:, project_id:, redirect_uri:, state: {})
98
+ ```
99
+
100
+ > Generate an authorization URL to intitiate the WorkOS OAuth2 workflow.
101
+
102
+ `WorkOS::SSO.authorization_url` accepts four arguments:
103
+
104
+ - `domain` (string) — the authenticating user's company domain, without protocol (ex. `example.com`)
105
+ - `project_id` (string) — your application's WorkOS [Project ID](https://dashboard.workos.com/sso/configuration) (ex. `project_01JG3BCPTRTSTTWQR4VSHXGWCQ`)
106
+ - `state` (optional, hash) — an optional hash used to manage state across authorization transactions (ex. `{ next_page: '/docs'}`)
107
+ - `redirect_uri` (string) — a callback URL where your application redirects the user-agent after an authorization code is granted (ex. `workos.dev/callback`). This must match one of your configured callback URLs for the associated project on your WorkOS dashboard.
108
+
109
+ This method will return an OAuth2 query string of the form:
110
+
111
+ `https://${domain}/sso/authorize?response_type=code&client_id=${projectID}&redirect_uri=${redirectURI}&state=${state}`
112
+
113
+ For example, when used in a [Sinatra app](http://sinatrarb.com/):
114
+
115
+ ```ruby
116
+ DOMAIN = 'example.com'
117
+ PROJECT_ID = '{projectId}'
118
+ REDIRECT_URI = 'http://localhost:4567/callback'
119
+
120
+ get '/auth' do
121
+ authorization_url = WorkOS::SSO.authorization_url(
122
+ domain: DOMAIN,
123
+ project_id: PROJECT_ID,
124
+ redirect_uri: REDIRECT_URI,
125
+ )
126
+
127
+ redirect authorization_url
128
+ end
129
+ ```
130
+
131
+ The user would be redirected to:
132
+
133
+ `https://api.workos.com/sso/authorize?response_type=code&client_id={projectID}&redirect_uri=http://localhost:4567/callback`
134
+
135
+ WorkOS takes over from here, sending the user to authenticate with their IDP, and on successful login, returns
136
+ the user to your callback URL with a `code` parameter. You'll use `WorkOS::SSO.profile` to exchange the
137
+ code for a `WorkOS::Profile`.
138
+
139
+ ```ruby
140
+ WorkOS::SSO.profile(code:, project_id:)</h4>
141
+ ```
142
+
143
+ > Fetch a WorkOS::Profile for an authorized user.
144
+
145
+ `WorkOS::SSO.profile` accepts two arguments:
146
+
147
+ - `code` (string) — an opaque string provided by the authorization server; will be exchanged for an Access Token when the user's profile is sent
148
+ - `project_id` (string) — your application's WorkOS [Project ID](https://dashboard.workos.com/sso/configuration) (ex. `project_01JG3BCPTRTSTTWQR4VSHXGWCQ`)
149
+
150
+ This method will return an instance of a `WorkOS::Profile` with the following attributes:
151
+
152
+ ```ruby
153
+ <WorkOS::Profile:0x00007fb6e4193d20
154
+ @id="prof_01DRA1XNSJDZ19A31F183ECQW5",
155
+ @email="demo@workos-okta.com",
156
+ @first_name="WorkOS",
157
+ @connection_type="OktaSAML",
158
+ @last_name="Demo",
159
+ @idp_id="00u1klkowm8EGah2H357",
160
+ >
17
161
  ```
18
162
 
19
- ### Requirements
163
+ Our Sintatra app can be extended to use this method:
164
+
165
+ ```ruby
166
+ DOMAIN = 'example.com'
167
+ PROJECT_ID = '{projectId}'
168
+ REDIRECT_URI = 'http://localhost:4567/callback'
169
+
170
+ get '/auth' do
171
+ authorization_url = WorkOS::SSO.authorization_url(
172
+ domain: DOMAIN,
173
+ project_id: PROJECT_ID,
174
+ redirect_uri: REDIRECT_URI,
175
+ )
176
+
177
+ redirect authorization_url
178
+ end
179
+
180
+ get '/callback' do
181
+ profile = WorkOS::SSO.profile(
182
+ code: params['code'],
183
+ project_id: PROJECT_ID,
184
+ )
185
+
186
+ session[:user] = profile.to_json
187
+
188
+ redirect '/'
189
+ end
190
+ ```
20
191
 
21
- - Ruby 2.3+.
192
+ Given the `WorkOS::Profile`, you can now sign the user in according to your own authentication setup.
data/bin/docs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- yard -o docs
3
+ bundle exec yard -o docs
4
4
  rm docs/index.html
5
- mv docs/_index.html docs/index.html
5
+ mv docs/_index.html docs/index.html
@@ -1,5 +1,6 @@
1
1
  coverage:
2
2
  status:
3
+ patch: off
3
4
  project:
4
5
  default:
5
6
  target: 90%
@@ -6,15 +6,15 @@
6
6
  <title>
7
7
  Module: WorkOS
8
8
 
9
- &mdash; Documentation by YARD 0.9.20
9
+ &mdash; Documentation by YARD 0.9.22
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
14
 
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
16
 
17
- <script type="text/javascript" charset="utf-8">
17
+ <script type="text/javascript">
18
18
  pathId = "WorkOS";
19
19
  relpath = '';
20
20
  </script>
@@ -79,7 +79,7 @@
79
79
  <dl>
80
80
  <dt>Defined in:</dt>
81
81
  <dd>lib/workos.rb<span class="defines">,<br />
82
- lib/workos/sso.rb,<br /> lib/workos/base.rb,<br /> lib/workos/types.rb,<br /> lib/workos/profile.rb,<br /> lib/workos/version.rb,<br /> lib/workos/request_error.rb,<br /> lib/workos/types/profile_struct.rb</span>
82
+ lib/workos/sso.rb,<br /> lib/workos/base.rb,<br /> lib/workos/types.rb,<br /> lib/workos/client.rb,<br /> lib/workos/errors.rb,<br /> lib/workos/profile.rb,<br /> lib/workos/version.rb,<br /> lib/workos/audit_log.rb,<br /> lib/workos/types/provider_enum.rb,<br /> lib/workos/types/profile_struct.rb</span>
83
83
  </dd>
84
84
  </dl>
85
85
 
@@ -88,11 +88,7 @@
88
88
  <h2>Overview</h2><div class="docstring">
89
89
  <div class="discussion">
90
90
 
91
- <p>Use the WorkOS module to authenticate your requests to the WorkOS API. The
92
- gem will read your API key automatically from the ENV var `WORKOS_KEY`.
93
- Alternatively, you can set the key yourself with `WorkOS.key = [your api
94
- key]` somewhere in the load path of your application, such as an
95
- initializer.</p>
91
+ <p>typed: strict</p>
96
92
 
97
93
 
98
94
  </div>
@@ -104,11 +100,11 @@ initializer.</p>
104
100
  <p class="children">
105
101
 
106
102
 
107
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="WorkOS/SSO.html" title="WorkOS::SSO (module)">SSO</a></span>, <span class='object_link'><a href="WorkOS/Types.html" title="WorkOS::Types (module)">Types</a></span>
103
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="WorkOS/AuditLog.html" title="WorkOS::AuditLog (module)">AuditLog</a></span>, <span class='object_link'><a href="WorkOS/Base.html" title="WorkOS::Base (module)">Base</a></span>, <span class='object_link'><a href="WorkOS/Client.html" title="WorkOS::Client (module)">Client</a></span>, <span class='object_link'><a href="WorkOS/SSO.html" title="WorkOS::SSO (module)">SSO</a></span>, <span class='object_link'><a href="WorkOS/Types.html" title="WorkOS::Types (module)">Types</a></span>
108
104
 
109
105
 
110
106
 
111
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="WorkOS/Base.html" title="WorkOS::Base (class)">Base</a></span>, <span class='object_link'><a href="WorkOS/Profile.html" title="WorkOS::Profile (class)">Profile</a></span>, <span class='object_link'><a href="WorkOS/RequestError.html" title="WorkOS::RequestError (class)">RequestError</a></span>
107
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="WorkOS/APIError.html" title="WorkOS::APIError (class)">APIError</a></span>, <span class='object_link'><a href="WorkOS/AuthenticationError.html" title="WorkOS::AuthenticationError (class)">AuthenticationError</a></span>, <span class='object_link'><a href="WorkOS/InvalidRequestError.html" title="WorkOS::InvalidRequestError (class)">InvalidRequestError</a></span>, <span class='object_link'><a href="WorkOS/Profile.html" title="WorkOS::Profile (class)">Profile</a></span>, <span class='object_link'><a href="WorkOS/WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span>
112
108
 
113
109
 
114
110
  </p>
@@ -129,7 +125,7 @@ initializer.</p>
129
125
  <dt id="VERSION-constant" class="">VERSION =
130
126
 
131
127
  </dt>
132
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.0.2</span><span class='tstring_end'>&#39;</span></span></pre></dd>
128
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.1.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>
133
129
 
134
130
  </dl>
135
131
 
@@ -238,15 +234,15 @@ initializer.</p>
238
234
  <pre class="lines">
239
235
 
240
236
 
237
+ 20
241
238
  21
242
- 22
243
- 23</pre>
239
+ 22</pre>
244
240
  </td>
245
241
  <td>
246
- <pre class="code"><span class="info file"># File 'lib/workos.rb', line 21</span>
242
+ <pre class="code"><span class="info file"># File 'lib/workos.rb', line 20</span>
247
243
 
248
244
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span>
249
- <span class='const'><span class='object_link'><a href="WorkOS/Base.html" title="WorkOS::Base (class)">Base</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key'><span class='object_link'><a href="WorkOS/Base.html#key-class_method" title="WorkOS::Base.key (method)">key</a></span></span>
245
+ <span class='const'><span class='object_link'><a href="WorkOS/Base.html" title="WorkOS::Base (module)">Base</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key'><span class='object_link'><a href="WorkOS/Base.html#key-class_method" title="WorkOS::Base.key (method)">key</a></span></span>
250
246
  <span class='kw'>end</span></pre>
251
247
  </td>
252
248
  </tr>
@@ -268,12 +264,12 @@ initializer.</p>
268
264
  <pre class="lines">
269
265
 
270
266
 
267
+ 24
271
268
  25
272
- 26
273
- 27</pre>
269
+ 26</pre>
274
270
  </td>
275
271
  <td>
276
- <pre class="code"><span class="info file"># File 'lib/workos.rb', line 25</span>
272
+ <pre class="code"><span class="info file"># File 'lib/workos.rb', line 24</span>
277
273
 
278
274
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_key!'>key!</span>
279
275
  <span class='id identifier rubyid_key'>key</span> <span class='op'>||</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>WorkOS.key not set</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
@@ -298,15 +294,15 @@ initializer.</p>
298
294
  <pre class="lines">
299
295
 
300
296
 
297
+ 16
301
298
  17
302
- 18
303
- 19</pre>
299
+ 18</pre>
304
300
  </td>
305
301
  <td>
306
- <pre class="code"><span class="info file"># File 'lib/workos.rb', line 17</span>
302
+ <pre class="code"><span class="info file"># File 'lib/workos.rb', line 16</span>
307
303
 
308
304
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_key='>key=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
309
- <span class='const'><span class='object_link'><a href="WorkOS/Base.html" title="WorkOS::Base (class)">Base</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key'><span class='object_link'><a href="WorkOS/Base.html#key-class_method" title="WorkOS::Base.key (method)">key</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
305
+ <span class='const'><span class='object_link'><a href="WorkOS/Base.html" title="WorkOS::Base (module)">Base</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key'><span class='object_link'><a href="WorkOS/Base.html#key-class_method" title="WorkOS::Base.key (method)">key</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
310
306
  <span class='kw'>end</span></pre>
311
307
  </td>
312
308
  </tr>
@@ -318,9 +314,9 @@ initializer.</p>
318
314
  </div>
319
315
 
320
316
  <div id="footer">
321
- Generated on Wed Dec 18 08:33:35 2019 by
317
+ Generated on Thu Jan 30 09:12:47 2020 by
322
318
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
323
- 0.9.20 (ruby-2.4.9).
319
+ 0.9.22 (ruby-2.6.5).
324
320
  </div>
325
321
 
326
322
  </div>
@@ -0,0 +1,160 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Exception: WorkOS::APIError
8
+
9
+ &mdash; Documentation by YARD 0.9.22
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "WorkOS::APIError";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (A)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span>
41
+ &raquo;
42
+ <span class="title">APIError</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Exception: WorkOS::APIError
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">StandardError</li>
78
+
79
+ <li class="next"><span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></li>
80
+
81
+ <li class="next">WorkOS::APIError</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+ </dl>
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <dl>
100
+ <dt>Defined in:</dt>
101
+ <dd>lib/workos/errors.rb</dd>
102
+ </dl>
103
+
104
+ </div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>APIError is a generic error that may be raised in cases where none of the other named errors cover the problem. It could also be raised in the case that a new error has been introduced in the API, but this version of the Ruby SDK doesn&#39;t know how to handle it.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+
122
+
123
+ <h2>Instance Attribute Summary</h2>
124
+
125
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></h3>
126
+ <p class="inherited"><span class='object_link'><a href="WorkOSError.html#http_status-instance_method" title="WorkOS::WorkOSError#http_status (method)">#http_status</a></span>, <span class='object_link'><a href="WorkOSError.html#request_id-instance_method" title="WorkOS::WorkOSError#request_id (method)">#request_id</a></span></p>
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+ <h2>Method Summary</h2>
137
+
138
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="WorkOSError.html" title="WorkOS::WorkOSError (class)">WorkOSError</a></span></h3>
139
+ <p class="inherited"><span class='object_link'><a href="WorkOSError.html#initialize-instance_method" title="WorkOS::WorkOSError#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="WorkOSError.html#to_s-instance_method" title="WorkOS::WorkOSError#to_s (method)">#to_s</a></span></p>
140
+
141
+
142
+ <div id="constructor_details" class="method_details_list">
143
+ <h2>Constructor Details</h2>
144
+
145
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="WorkOSError.html#initialize-instance_method" title="WorkOS::WorkOSError#initialize (method)">WorkOS::WorkOSError</a></span></p>
146
+
147
+ </div>
148
+
149
+
150
+ </div>
151
+
152
+ <div id="footer">
153
+ Generated on Thu Jan 30 09:12:47 2020 by
154
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
155
+ 0.9.22 (ruby-2.6.5).
156
+ </div>
157
+
158
+ </div>
159
+ </body>
160
+ </html>