ed_fi_client 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +78 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +5 -0
  7. data/.yardopts +1 -0
  8. data/Gemfile +6 -0
  9. data/Gemfile.lock +65 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +113 -0
  12. data/Rakefile +6 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/docs/EdFi.html +127 -0
  16. data/docs/EdFi/Client.html +1204 -0
  17. data/docs/EdFi/Client/AccessToken.html +541 -0
  18. data/docs/EdFi/Client/ArgumentError.html +143 -0
  19. data/docs/EdFi/Client/Auth.html +440 -0
  20. data/docs/EdFi/Client/Error.html +139 -0
  21. data/docs/EdFi/Client/Proxy.html +521 -0
  22. data/docs/EdFi/Client/Response.html +479 -0
  23. data/docs/EdFi/Client/UnableToAuthenticateError.html +145 -0
  24. data/docs/_index.html +203 -0
  25. data/docs/class_list.html +51 -0
  26. data/docs/css/common.css +1 -0
  27. data/docs/css/full_list.css +58 -0
  28. data/docs/css/style.css +499 -0
  29. data/docs/file.README.html +124 -0
  30. data/docs/file_list.html +56 -0
  31. data/docs/frames.html +17 -0
  32. data/docs/index.html +124 -0
  33. data/docs/js/app.js +248 -0
  34. data/docs/js/full_list.js +216 -0
  35. data/docs/js/jquery.js +4 -0
  36. data/docs/method_list.html +235 -0
  37. data/docs/top-level-namespace.html +110 -0
  38. data/ed_fi_client.gemspec +32 -0
  39. data/lib/ed_fi/client.rb +244 -0
  40. data/lib/ed_fi/client/access_token.rb +63 -0
  41. data/lib/ed_fi/client/auth.rb +99 -0
  42. data/lib/ed_fi/client/errors.rb +19 -0
  43. data/lib/ed_fi/client/proxy.rb +65 -0
  44. data/lib/ed_fi/client/response.rb +150 -0
  45. data/lib/ed_fi/client/version.rb +18 -0
  46. data/lib/ed_fi_client.rb +1 -0
  47. metadata +201 -0
@@ -0,0 +1,541 @@
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
+ Class: EdFi::Client::AccessToken
8
+
9
+ &mdash; Documentation by YARD 0.9.12
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "EdFi::Client::AccessToken";
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="../../EdFi.html" title="EdFi (module)">EdFi</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Client.html" title="EdFi::Client (class)">Client</a></span></span>
41
+ &raquo;
42
+ <span class="title">AccessToken</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>Class: EdFi::Client::AccessToken
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">EdFi::Client::AccessToken</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/ed_fi/client/access_token.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>The <span class='object_link'><a href="" title="EdFi::Client::AccessToken (class)">EdFi::Client::AccessToken</a></span> represents an
106
+ access token, as returned by “/oauth/token” calls.</p>
107
+
108
+
109
+ </div>
110
+ </div>
111
+ <div class="tags">
112
+
113
+
114
+ </div>
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ <h2>
123
+ Instance Method Summary
124
+ <small><a href="#" class="summary_toggle">collapse</a></small>
125
+ </h2>
126
+
127
+ <ul class="summary">
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#expires_at-instance_method" title="#expires_at (instance method)">#<strong>expires_at</strong> &#x21d2; Time </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>Gives the token&#39;s <em>calculated</em> expiration Time.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
153
+ <li class="public ">
154
+ <span class="summary_signature">
155
+
156
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(access_token:, token_type:, issued_at: Time.current, expires_in:) &#x21d2; AccessToken </a>
157
+
158
+
159
+
160
+ </span>
161
+
162
+
163
+ <span class="note title constructor">constructor</span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+ <span class="summary_desc"><div class='inline'>
173
+ <p>An <span class='object_link'><a href="" title="EdFi::Client::AccessToken (class)">EdFi::Client::AccessToken</a></span> can be
174
+ initiialized with the “/oauth/token” response Hash.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ <li class="public ">
181
+ <span class="summary_signature">
182
+
183
+ <a href="#token-instance_method" title="#token (instance method)">#<strong>token</strong> &#x21d2; String </a>
184
+
185
+
186
+
187
+ </span>
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <span class="summary_desc"><div class='inline'>
198
+ <p>Gives a copy of the token <em>value</em>.</p>
199
+ </div></span>
200
+
201
+ </li>
202
+
203
+
204
+ <li class="public ">
205
+ <span class="summary_signature">
206
+
207
+ <a href="#valid%3F-instance_method" title="#valid? (instance method)">#<strong>valid?</strong> &#x21d2; true, false </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ <span class="summary_desc"><div class='inline'>
222
+ <p>Denotes whether the token is still “valid”, per its (calculated) expiration
223
+ timesstamp.</p>
224
+ </div></span>
225
+
226
+ </li>
227
+
228
+
229
+ </ul>
230
+
231
+
232
+ <div id="constructor_details" class="method_details_list">
233
+ <h2>Constructor Details</h2>
234
+
235
+ <div class="method_details first">
236
+ <h3 class="signature first" id="initialize-instance_method">
237
+
238
+ #<strong>initialize</strong>(access_token:, token_type:, issued_at: Time.current, expires_in:) &#x21d2; <tt><span class='object_link'><a href="" title="EdFi::Client::AccessToken (class)">AccessToken</a></span></tt>
239
+
240
+
241
+
242
+
243
+
244
+ </h3><div class="docstring">
245
+ <div class="discussion">
246
+
247
+ <p>An <span class='object_link'><a href="" title="EdFi::Client::AccessToken (class)">EdFi::Client::AccessToken</a></span> can be
248
+ initiialized with the “/oauth/token” response Hash. If given, an additional
249
+ “issued_at” Time value helps to more accurately calculate the token&#39;s
250
+ expiration Time.</p>
251
+
252
+
253
+ </div>
254
+ </div>
255
+ <div class="tags">
256
+ <p class="tag_title">Parameters:</p>
257
+ <ul class="param">
258
+
259
+ <li>
260
+
261
+ <span class='name'>access_token</span>
262
+
263
+
264
+ <span class='type'>(<tt>String</tt>)</span>
265
+
266
+
267
+
268
+ &mdash;
269
+ <div class='inline'>
270
+ <p>The actual token value to use as the Bearer token in subsequent requests.</p>
271
+ </div>
272
+
273
+ </li>
274
+
275
+ <li>
276
+
277
+ <span class='name'>token_type</span>
278
+
279
+
280
+ <span class='type'>(<tt>String</tt>)</span>
281
+
282
+
283
+
284
+ &mdash;
285
+ <div class='inline'>
286
+ <p>The token type (e.g. “bearer”).</p>
287
+ </div>
288
+
289
+ </li>
290
+
291
+ <li>
292
+
293
+ <span class='name'>issued_at</span>
294
+
295
+
296
+ <span class='type'>(<tt>Time</tt>)</span>
297
+
298
+
299
+
300
+ &mdash;
301
+ <div class='inline'>
302
+ <p>An optional value denoting the Time at which the token was issued. If
303
+ unset, defaults to <code>Time.current</code>.</p>
304
+ </div>
305
+
306
+ </li>
307
+
308
+ <li>
309
+
310
+ <span class='name'>expires_in</span>
311
+
312
+
313
+ <span class='type'>(<tt>Numeric</tt>)</span>
314
+
315
+
316
+
317
+ &mdash;
318
+ <div class='inline'>
319
+ <p>The token&#39;s lifetime, in seconds.</p>
320
+ </div>
321
+
322
+ </li>
323
+
324
+ </ul>
325
+
326
+
327
+ </div><table class="source_code">
328
+ <tr>
329
+ <td>
330
+ <pre class="lines">
331
+
332
+
333
+ 26
334
+ 27
335
+ 28
336
+ 29
337
+ 30
338
+ 31</pre>
339
+ </td>
340
+ <td>
341
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client/access_token.rb', line 26</span>
342
+
343
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>access_token:</span><span class='comma'>,</span> <span class='label'>token_type:</span><span class='comma'>,</span> <span class='label'>issued_at:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='comma'>,</span> <span class='label'>expires_in:</span><span class='rparen'>)</span>
344
+ <span class='ivar'>@access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
345
+ <span class='ivar'>@token_type</span> <span class='op'>=</span> <span class='id identifier rubyid_token_type'>token_type</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
346
+ <span class='ivar'>@issued_at</span> <span class='op'>=</span> <span class='id identifier rubyid_issued_at'>issued_at</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
347
+ <span class='ivar'>@expires_in</span> <span class='op'>=</span> <span class='id identifier rubyid_expires_in'>expires_in</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
348
+ <span class='kw'>end</span></pre>
349
+ </td>
350
+ </tr>
351
+ </table>
352
+ </div>
353
+
354
+ </div>
355
+
356
+
357
+ <div id="instance_method_details" class="method_details_list">
358
+ <h2>Instance Method Details</h2>
359
+
360
+
361
+ <div class="method_details first">
362
+ <h3 class="signature first" id="expires_at-instance_method">
363
+
364
+ #<strong>expires_at</strong> &#x21d2; <tt>Time</tt>
365
+
366
+
367
+
368
+
369
+
370
+ </h3><div class="docstring">
371
+ <div class="discussion">
372
+
373
+ <p>Gives the token&#39;s <em>calculated</em> expiration Time.</p>
374
+
375
+
376
+ </div>
377
+ </div>
378
+ <div class="tags">
379
+
380
+ <p class="tag_title">Returns:</p>
381
+ <ul class="return">
382
+
383
+ <li>
384
+
385
+
386
+ <span class='type'>(<tt>Time</tt>)</span>
387
+
388
+
389
+
390
+ </li>
391
+
392
+ </ul>
393
+
394
+ </div><table class="source_code">
395
+ <tr>
396
+ <td>
397
+ <pre class="lines">
398
+
399
+
400
+ 47
401
+ 48
402
+ 49
403
+ 50</pre>
404
+ </td>
405
+ <td>
406
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client/access_token.rb', line 47</span>
407
+
408
+ <span class='kw'>def</span> <span class='id identifier rubyid_expires_at'>expires_at</span>
409
+ <span class='kw'>return</span> <span class='int'>1</span><span class='period'>.</span><span class='id identifier rubyid_second'>second</span><span class='period'>.</span><span class='id identifier rubyid_ago'>ago</span> <span class='kw'>if</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
410
+ <span class='lparen'>(</span><span class='ivar'>@issued_at</span> <span class='op'>+</span> <span class='ivar'>@expires_in</span><span class='period'>.</span><span class='id identifier rubyid_seconds'>seconds</span><span class='rparen'>)</span>
411
+ <span class='kw'>end</span></pre>
412
+ </td>
413
+ </tr>
414
+ </table>
415
+ </div>
416
+
417
+ <div class="method_details ">
418
+ <h3 class="signature " id="token-instance_method">
419
+
420
+ #<strong>token</strong> &#x21d2; <tt>String</tt>
421
+
422
+
423
+
424
+
425
+
426
+ </h3><div class="docstring">
427
+ <div class="discussion">
428
+
429
+ <p>Gives a copy of the token <em>value</em>.</p>
430
+
431
+
432
+ </div>
433
+ </div>
434
+ <div class="tags">
435
+
436
+ <p class="tag_title">Returns:</p>
437
+ <ul class="return">
438
+
439
+ <li>
440
+
441
+
442
+ <span class='type'>(<tt>String</tt>)</span>
443
+
444
+
445
+
446
+ </li>
447
+
448
+ </ul>
449
+
450
+ </div><table class="source_code">
451
+ <tr>
452
+ <td>
453
+ <pre class="lines">
454
+
455
+
456
+ 38
457
+ 39
458
+ 40</pre>
459
+ </td>
460
+ <td>
461
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client/access_token.rb', line 38</span>
462
+
463
+ <span class='kw'>def</span> <span class='id identifier rubyid_token'>token</span>
464
+ <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
465
+ <span class='kw'>end</span></pre>
466
+ </td>
467
+ </tr>
468
+ </table>
469
+ </div>
470
+
471
+ <div class="method_details ">
472
+ <h3 class="signature " id="valid?-instance_method">
473
+
474
+ #<strong>valid?</strong> &#x21d2; <tt>true</tt>, <tt>false</tt>
475
+
476
+
477
+
478
+
479
+
480
+ </h3><div class="docstring">
481
+ <div class="discussion">
482
+
483
+ <p>Denotes whether the token is still “valid”, per its (calculated) expiration
484
+ timesstamp. Note that a 5-second window is allotted for the request using
485
+ the token to complete.</p>
486
+
487
+
488
+ </div>
489
+ </div>
490
+ <div class="tags">
491
+
492
+ <p class="tag_title">Returns:</p>
493
+ <ul class="return">
494
+
495
+ <li>
496
+
497
+
498
+ <span class='type'>(<tt>true</tt>, <tt>false</tt>)</span>
499
+
500
+
501
+
502
+ </li>
503
+
504
+ </ul>
505
+
506
+ </div><table class="source_code">
507
+ <tr>
508
+ <td>
509
+ <pre class="lines">
510
+
511
+
512
+ 58
513
+ 59
514
+ 60
515
+ 61</pre>
516
+ </td>
517
+ <td>
518
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client/access_token.rb', line 58</span>
519
+
520
+ <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
521
+ <span class='id identifier rubyid_safety_window'>safety_window</span> <span class='op'>=</span> <span class='int'>5</span><span class='period'>.</span><span class='id identifier rubyid_seconds'>seconds</span>
522
+ <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span> <span class='op'>&lt;=</span> <span class='lparen'>(</span><span class='id identifier rubyid_expires_at'>expires_at</span> <span class='op'>-</span> <span class='id identifier rubyid_safety_window'>safety_window</span><span class='rparen'>)</span>
523
+ <span class='kw'>end</span></pre>
524
+ </td>
525
+ </tr>
526
+ </table>
527
+ </div>
528
+
529
+ </div>
530
+
531
+ </div>
532
+
533
+ <div id="footer">
534
+ Generated on Thu May 24 18:35:39 2018 by
535
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
536
+ 0.9.12 (ruby-2.5.1).
537
+ </div>
538
+
539
+ </div>
540
+ </body>
541
+ </html>