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,1204 @@
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
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";
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 (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../EdFi.html" title="EdFi (module)">EdFi</a></span></span>
41
+ &raquo;
42
+ <span class="title">Client</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
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Crapi::Client</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Crapi::Client</li>
78
+
79
+ <li class="next">EdFi::Client</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/ed_fi/client.rb<span class="defines">,<br />
100
+ lib/ed_fi/client/version.rb,<br /> lib/ed_fi/client/response.rb,<br /> lib/ed_fi/client/access_token.rb,<br /> lib/ed_fi/client/errors.rb,<br /> lib/ed_fi/client/proxy.rb,<br /> lib/ed_fi/client/auth.rb</span>
101
+ </dd>
102
+ </dl>
103
+
104
+ </div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>The main container defined by the <strong>ed_fi_client</strong> gem.
110
+ Provides a connection mechanism, an authentication mechanism, simple CRUD
111
+ methods (<span class='object_link'><a href="#delete-instance_method" title="EdFi::Client#delete (method)">#delete</a></span> / <span class='object_link'><a href="#get-instance_method" title="EdFi::Client#get (method)">#get</a></span> / <span class='object_link'><a href="#patch-instance_method" title="EdFi::Client#patch (method)">#patch</a></span> / <span class='object_link'><a href="#post-instance_method" title="EdFi::Client#post (method)">#post</a></span> / <span class='object_link'><a href="#put-instance_method" title="EdFi::Client#put (method)">#put</a></span>), and proxy
112
+ generators.</p>
113
+
114
+ <p>All other classes defined in this gem (including gem-specific
115
+ <code>::Error</code> derivatives) are subclasses of <span class='object_link'><a href="" title="EdFi::Client (class)">EdFi::Client</a></span>.</p>
116
+
117
+
118
+ </div>
119
+ </div>
120
+ <div class="tags">
121
+
122
+
123
+ </div><h2>Defined Under Namespace</h2>
124
+ <p class="children">
125
+
126
+
127
+
128
+
129
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Client/AccessToken.html" title="EdFi::Client::AccessToken (class)">AccessToken</a></span>, <span class='object_link'><a href="Client/ArgumentError.html" title="EdFi::Client::ArgumentError (class)">ArgumentError</a></span>, <span class='object_link'><a href="Client/Auth.html" title="EdFi::Client::Auth (class)">Auth</a></span>, <span class='object_link'><a href="Client/Error.html" title="EdFi::Client::Error (class)">Error</a></span>, <span class='object_link'><a href="Client/Proxy.html" title="EdFi::Client::Proxy (class)">Proxy</a></span>, <span class='object_link'><a href="Client/Response.html" title="EdFi::Client::Response (class)">Response</a></span>, <span class='object_link'><a href="Client/UnableToAuthenticateError.html" title="EdFi::Client::UnableToAuthenticateError (class)">UnableToAuthenticateError</a></span>
130
+
131
+
132
+ </p>
133
+
134
+ <h2>Constant Summary</h2>
135
+ <dl class="constants">
136
+
137
+ <dt id="VERSION-constant" class="">VERSION =
138
+ <div class="docstring">
139
+ <div class="discussion">
140
+
141
+ <p>The canonical <strong>ed_fi_client</strong> gem version.</p>
142
+
143
+ <p>This should only ever be updated <em>immediately</em> before a release; the
144
+ commit that updates this value should be pushed <strong>by</strong> the
145
+ <code>rake release</code> process.</p>
146
+
147
+
148
+ </div>
149
+ </div>
150
+ <div class="tags">
151
+
152
+
153
+ </div>
154
+ </dt>
155
+ <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><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
156
+
157
+ <dt id="PROFILE_MIME_TYPE-constant" class="">PROFILE_MIME_TYPE =
158
+ <div class="docstring">
159
+ <div class="discussion">
160
+
161
+ <p>The “profile” header content-type template.</p>
162
+
163
+
164
+ </div>
165
+ </div>
166
+ <div class="tags">
167
+
168
+
169
+ </div>
170
+ </dt>
171
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>application/vnd.ed-fi.%&lt;resource&gt;s.%&lt;profile&gt;s.%&lt;access&gt;s+json</span><span class='tstring_end'>&#39;</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
172
+
173
+ </dl>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ <h2>
183
+ Instance Method Summary
184
+ <small><a href="#" class="summary_toggle">collapse</a></small>
185
+ </h2>
186
+
187
+ <ul class="summary">
188
+
189
+ <li class="public ">
190
+ <span class="summary_signature">
191
+
192
+ <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong>(path, headers: {}, query: {}) &#x21d2; Object </a>
193
+
194
+
195
+
196
+ </span>
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <span class="summary_desc"><div class='inline'>
207
+ <p>CRUD method: DELETE.</p>
208
+ </div></span>
209
+
210
+ </li>
211
+
212
+
213
+ <li class="public ">
214
+ <span class="summary_signature">
215
+
216
+ <a href="#get-instance_method" title="#get (instance method)">#<strong>get</strong>(path, headers: {}, query: {}) &#x21d2; Object </a>
217
+
218
+
219
+
220
+ </span>
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+ <span class="summary_desc"><div class='inline'>
231
+ <p>CRUD method: GET.</p>
232
+ </div></span>
233
+
234
+ </li>
235
+
236
+
237
+ <li class="public ">
238
+ <span class="summary_signature">
239
+
240
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(base_uri, opts = {}) &#x21d2; Client </a>
241
+
242
+
243
+
244
+ </span>
245
+
246
+
247
+ <span class="note title constructor">constructor</span>
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+ <span class="summary_desc"><div class='inline'>
257
+ <p>A new instance of Client.</p>
258
+ </div></span>
259
+
260
+ </li>
261
+
262
+
263
+ <li class="public ">
264
+ <span class="summary_signature">
265
+
266
+ <a href="#patch-instance_method" title="#patch (instance method)">#<strong>patch</strong>(path, headers: {}, query: {}, payload: {}) &#x21d2; Object </a>
267
+
268
+
269
+
270
+ </span>
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+ <span class="summary_desc"><div class='inline'>
281
+ <p>CRUD method: PATCH.</p>
282
+ </div></span>
283
+
284
+ </li>
285
+
286
+
287
+ <li class="public ">
288
+ <span class="summary_signature">
289
+
290
+ <a href="#post-instance_method" title="#post (instance method)">#<strong>post</strong>(path, headers: {}, query: {}, payload: {}) &#x21d2; Object </a>
291
+
292
+
293
+
294
+ </span>
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+ <span class="summary_desc"><div class='inline'>
305
+ <p>CRUD method: POST.</p>
306
+ </div></span>
307
+
308
+ </li>
309
+
310
+
311
+ <li class="public ">
312
+ <span class="summary_signature">
313
+
314
+ <a href="#profile=-instance_method" title="#profile= (instance method)">#<strong>profile=</strong>(profile) &#x21d2; Object </a>
315
+
316
+
317
+
318
+ </span>
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+ <span class="summary_desc"><div class='inline'>
329
+ <p>Sets the profile to use for <span class='object_link'><a href="#read-instance_method" title="EdFi::Client#read (method)">#read</a></span> / <span class='object_link'><a href="#write-instance_method" title="EdFi::Client#write (method)">#write</a></span>
330
+ calls.</p>
331
+ </div></span>
332
+
333
+ </li>
334
+
335
+
336
+ <li class="public ">
337
+ <span class="summary_signature">
338
+
339
+ <a href="#put-instance_method" title="#put (instance method)">#<strong>put</strong>(path, headers: {}, query: {}, payload: {}) &#x21d2; Object </a>
340
+
341
+
342
+
343
+ </span>
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+ <span class="summary_desc"><div class='inline'>
354
+ <p>CRUD method: PUT.</p>
355
+ </div></span>
356
+
357
+ </li>
358
+
359
+
360
+ <li class="public ">
361
+ <span class="summary_signature">
362
+
363
+ <a href="#read-instance_method" title="#read (instance method)">#<strong>read</strong>(resource, as: nil) &#x21d2; HashWithIndifferentAccess </a>
364
+
365
+
366
+
367
+ </span>
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+ <span class="summary_desc"><div class='inline'>
378
+ <p>Returns the header needed to <span class='object_link'><a href="#get-instance_method" title="EdFi::Client#get (method)">#get</a></span> a resource with a profile.</p>
379
+ </div></span>
380
+
381
+ </li>
382
+
383
+
384
+ <li class="public ">
385
+ <span class="summary_signature">
386
+
387
+ <a href="#v2-instance_method" title="#v2 (instance method)">#<strong>v2</strong>(period) &#x21d2; EdFi::Client::Proxy </a>
388
+
389
+
390
+
391
+ </span>
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+ <span class="summary_desc"><div class='inline'>
402
+ <p>Convenience proxy generator for v2.0 API access, adding also the school
403
+ year you&#39;d like to access.</p>
404
+ </div></span>
405
+
406
+ </li>
407
+
408
+
409
+ <li class="public ">
410
+ <span class="summary_signature">
411
+
412
+ <a href="#write-instance_method" title="#write (instance method)">#<strong>write</strong>(resource, as: nil) &#x21d2; HashWithIndifferentAccess </a>
413
+
414
+
415
+
416
+ </span>
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+ <span class="summary_desc"><div class='inline'>
427
+ <p>Returns the header needed to <span class='object_link'><a href="#delete-instance_method" title="EdFi::Client#delete (method)">#delete</a></span> / <span class='object_link'><a href="#patch-instance_method" title="EdFi::Client#patch (method)">#patch</a></span> /
428
+ <span class='object_link'><a href="#post-instance_method" title="EdFi::Client#post (method)">#post</a></span> / <span class='object_link'><a href="#put-instance_method" title="EdFi::Client#put (method)">#put</a></span> a resource with a profile.</p>
429
+ </div></span>
430
+
431
+ </li>
432
+
433
+
434
+ </ul>
435
+
436
+
437
+
438
+ <div id="constructor_details" class="method_details_list">
439
+ <h2>Constructor Details</h2>
440
+
441
+ <div class="method_details first">
442
+ <h3 class="signature first" id="initialize-instance_method">
443
+
444
+ #<strong>initialize</strong>(base_uri, opts = {}) &#x21d2; <tt><span class='object_link'><a href="" title="EdFi::Client (class)">Client</a></span></tt>
445
+
446
+
447
+
448
+
449
+
450
+ </h3><div class="docstring">
451
+ <div class="discussion">
452
+
453
+ <p>Returns a new instance of Client</p>
454
+
455
+
456
+ </div>
457
+ </div>
458
+ <div class="tags">
459
+ <p class="tag_title">Parameters:</p>
460
+ <ul class="param">
461
+
462
+ <li>
463
+
464
+ <span class='name'>base_uri</span>
465
+
466
+
467
+ <span class='type'>(<tt>URI</tt>, <tt>String</tt>)</span>
468
+
469
+
470
+
471
+ &mdash;
472
+ <div class='inline'>
473
+ <p>The base URI the client should use for determining the host to connect to,
474
+ whether SSH is applicable, and the path to the target API.</p>
475
+ </div>
476
+
477
+ </li>
478
+
479
+ <li>
480
+
481
+ <span class='name'>opts</span>
482
+
483
+
484
+ <span class='type'>(<tt>Hash</tt>)</span>
485
+
486
+
487
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
488
+
489
+
490
+ &mdash;
491
+ <div class='inline'>
492
+ <p>Method options. All options not explicitly listed below are passed on to
493
+ Crapi::Client.</p>
494
+ </div>
495
+
496
+ </li>
497
+
498
+ </ul>
499
+
500
+
501
+
502
+
503
+
504
+
505
+ <p class="tag_title">Options Hash (<tt>opts</tt>):</p>
506
+ <ul class="option">
507
+
508
+ <li>
509
+ <span class="name">:profile</span>
510
+ <span class="type">(<tt>String</tt>)</span>
511
+ <span class="default">
512
+
513
+ </span>
514
+
515
+ &mdash; <div class='inline'>
516
+ <p>The profile for which <span class='object_link'><a href="#read-instance_method" title="EdFi::Client#read (method)">#read</a></span> and <span class='object_link'><a href="#write-instance_method" title="EdFi::Client#write (method)">#write</a></span> will
517
+ generate headers, if any.</p>
518
+ </div>
519
+
520
+ </li>
521
+
522
+ <li>
523
+ <span class="name">:client_id</span>
524
+ <span class="type">(<tt>String</tt>)</span>
525
+ <span class="default">
526
+
527
+ </span>
528
+
529
+ &mdash; <div class='inline'>
530
+ <p>The client id to use for authentication. This is AKA the “api key” /
531
+ “username”.</p>
532
+ </div>
533
+
534
+ </li>
535
+
536
+ <li>
537
+ <span class="name">:client_secret</span>
538
+ <span class="type">(<tt>String</tt>)</span>
539
+ <span class="default">
540
+
541
+ </span>
542
+
543
+ &mdash; <div class='inline'>
544
+ <p>The client secret to use for authentication. This is AKA the “api secret” /
545
+ “password”.</p>
546
+ </div>
547
+
548
+ </li>
549
+
550
+ </ul>
551
+
552
+
553
+ <p class="tag_title">Raises:</p>
554
+ <ul class="raise">
555
+
556
+ <li>
557
+
558
+
559
+ <span class='type'>(<tt><span class='object_link'><a href="Client/ArgumentError.html" title="EdFi::Client::ArgumentError (class)">EdFi::Client::ArgumentError</a></span></tt>)</span>
560
+
561
+
562
+
563
+ </li>
564
+
565
+ </ul>
566
+
567
+ </div><table class="source_code">
568
+ <tr>
569
+ <td>
570
+ <pre class="lines">
571
+
572
+
573
+ 41
574
+ 42
575
+ 43
576
+ 44
577
+ 45
578
+ 46
579
+ 47
580
+ 48
581
+ 49
582
+ 50
583
+ 51
584
+ 52
585
+ 53
586
+ 54
587
+ 55</pre>
588
+ </td>
589
+ <td>
590
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 41</span>
591
+
592
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_base_uri'>base_uri</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
593
+ <span class='id identifier rubyid_required_opts'>required_opts</span> <span class='op'>=</span> <span class='qsymbols_beg'>%i[</span><span class='tstring_content'>client_id</span><span class='words_sep'> </span><span class='tstring_content'>client_secret</span><span class='tstring_end'>]</span></span>
594
+ <span class='id identifier rubyid_required_opts'>required_opts</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_opt'>opt</span><span class='op'>|</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Client/ArgumentError.html" title="EdFi::Client::ArgumentError (class)">ArgumentError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>missing keyword: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_opt'>opt</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span> <span class='id identifier rubyid_opt'>opt</span> <span class='rbrace'>}</span>
595
+
596
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_base_uri'>base_uri</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
597
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_profile'>profile</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:profile</span><span class='rbracket'>]</span>
598
+
599
+ <span class='comment'>## Giving the EdFi::Client::Auth instance its own Crapi client lets us do fancy things with the
600
+ </span> <span class='comment'>## API segmenting stuff ...
601
+ </span> <span class='comment'>##
602
+ </span> <span class='id identifier rubyid_auth_client'>auth_client</span> <span class='op'>=</span> <span class='const'>Crapi</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_base_uri'>base_uri</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
603
+ <span class='ivar'>@auth</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../EdFi.html" title="EdFi (module)">EdFi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="EdFi::Client (class)">Client</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Client/Auth.html" title="EdFi::Client::Auth (class)">Auth</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Client/Auth.html#initialize-instance_method" title="EdFi::Client::Auth#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>client:</span> <span class='id identifier rubyid_auth_client'>auth_client</span><span class='comma'>,</span>
604
+ <span class='label'>client_id:</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:client_id</span><span class='rbracket'>]</span><span class='comma'>,</span>
605
+ <span class='label'>client_secret:</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:client_secret</span><span class='rbracket'>]</span><span class='rparen'>)</span>
606
+ <span class='kw'>end</span></pre>
607
+ </td>
608
+ </tr>
609
+ </table>
610
+ </div>
611
+
612
+ </div>
613
+
614
+
615
+ <div id="instance_method_details" class="method_details_list">
616
+ <h2>Instance Method Details</h2>
617
+
618
+
619
+ <div class="method_details first">
620
+ <h3 class="signature first" id="delete-instance_method">
621
+
622
+ #<strong>delete</strong>(path, headers: {}, query: {}) &#x21d2; <tt>Object</tt>
623
+
624
+
625
+
626
+
627
+
628
+ </h3><div class="docstring">
629
+ <div class="discussion">
630
+
631
+ <p>CRUD method: DELETE</p>
632
+
633
+ <p><em>headers</em> and <em>query</em> are preprocessed for auth and case
634
+ conversion, but all parameters are otherwise passed through to
635
+ Crapi::Proxy#delete.</p>
636
+
637
+
638
+ </div>
639
+ </div>
640
+ <div class="tags">
641
+
642
+
643
+ </div><table class="source_code">
644
+ <tr>
645
+ <td>
646
+ <pre class="lines">
647
+
648
+
649
+ 121
650
+ 122
651
+ 123
652
+ 124</pre>
653
+ </td>
654
+ <td>
655
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 121</span>
656
+
657
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
658
+ <span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
659
+ <span class='id identifier rubyid_respond_with'>respond_with</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
660
+ <span class='kw'>end</span></pre>
661
+ </td>
662
+ </tr>
663
+ </table>
664
+ </div>
665
+
666
+ <div class="method_details ">
667
+ <h3 class="signature " id="get-instance_method">
668
+
669
+ #<strong>get</strong>(path, headers: {}, query: {}) &#x21d2; <tt>Object</tt>
670
+
671
+
672
+
673
+
674
+
675
+ </h3><div class="docstring">
676
+ <div class="discussion">
677
+
678
+ <p>CRUD method: GET</p>
679
+
680
+ <p><em>headers</em> and <em>query</em> are preprocessed for auth and case
681
+ conversion, but all parameters are otherwise passed through to
682
+ Crapi::Proxy#get.</p>
683
+
684
+
685
+ </div>
686
+ </div>
687
+ <div class="tags">
688
+
689
+
690
+ </div><table class="source_code">
691
+ <tr>
692
+ <td>
693
+ <pre class="lines">
694
+
695
+
696
+ 131
697
+ 132
698
+ 133
699
+ 134</pre>
700
+ </td>
701
+ <td>
702
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 131</span>
703
+
704
+ <span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
705
+ <span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
706
+ <span class='id identifier rubyid_respond_with'>respond_with</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
707
+ <span class='kw'>end</span></pre>
708
+ </td>
709
+ </tr>
710
+ </table>
711
+ </div>
712
+
713
+ <div class="method_details ">
714
+ <h3 class="signature " id="patch-instance_method">
715
+
716
+ #<strong>patch</strong>(path, headers: {}, query: {}, payload: {}) &#x21d2; <tt>Object</tt>
717
+
718
+
719
+
720
+
721
+
722
+ </h3><div class="docstring">
723
+ <div class="discussion">
724
+
725
+ <p>CRUD method: PATCH</p>
726
+
727
+ <p><em>headers</em>, <em>query</em>, and <em>payload</em> are preprocessed for
728
+ auth and case conversion, but all parameters are otherwise passed through
729
+ to Crapi::Proxy#patch.</p>
730
+
731
+
732
+ </div>
733
+ </div>
734
+ <div class="tags">
735
+
736
+
737
+ </div><table class="source_code">
738
+ <tr>
739
+ <td>
740
+ <pre class="lines">
741
+
742
+
743
+ 141
744
+ 142
745
+ 143
746
+ 144</pre>
747
+ </td>
748
+ <td>
749
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 141</span>
750
+
751
+ <span class='kw'>def</span> <span class='id identifier rubyid_patch'>patch</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
752
+ <span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
753
+ <span class='id identifier rubyid_respond_with'>respond_with</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
754
+ <span class='kw'>end</span></pre>
755
+ </td>
756
+ </tr>
757
+ </table>
758
+ </div>
759
+
760
+ <div class="method_details ">
761
+ <h3 class="signature " id="post-instance_method">
762
+
763
+ #<strong>post</strong>(path, headers: {}, query: {}, payload: {}) &#x21d2; <tt>Object</tt>
764
+
765
+
766
+
767
+
768
+
769
+ </h3><div class="docstring">
770
+ <div class="discussion">
771
+
772
+ <p>CRUD method: POST</p>
773
+
774
+ <p><em>headers</em>, <em>query</em>, and <em>payload</em> are preprocessed for
775
+ auth and case conversion, but all parameters are otherwise passed through
776
+ to Crapi::Proxy#post.</p>
777
+
778
+
779
+ </div>
780
+ </div>
781
+ <div class="tags">
782
+
783
+
784
+ </div><table class="source_code">
785
+ <tr>
786
+ <td>
787
+ <pre class="lines">
788
+
789
+
790
+ 151
791
+ 152
792
+ 153
793
+ 154</pre>
794
+ </td>
795
+ <td>
796
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 151</span>
797
+
798
+ <span class='kw'>def</span> <span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
799
+ <span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
800
+ <span class='id identifier rubyid_respond_with'>respond_with</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
801
+ <span class='kw'>end</span></pre>
802
+ </td>
803
+ </tr>
804
+ </table>
805
+ </div>
806
+
807
+ <div class="method_details ">
808
+ <h3 class="signature " id="profile=-instance_method">
809
+
810
+ #<strong>profile=</strong>(profile) &#x21d2; <tt>Object</tt>
811
+
812
+
813
+
814
+
815
+
816
+ </h3><div class="docstring">
817
+ <div class="discussion">
818
+
819
+ <p>Sets the profile to use for <span class='object_link'><a href="#read-instance_method" title="EdFi::Client#read (method)">#read</a></span> / <span class='object_link'><a href="#write-instance_method" title="EdFi::Client#write (method)">#write</a></span>
820
+ calls.</p>
821
+
822
+
823
+ </div>
824
+ </div>
825
+ <div class="tags">
826
+ <p class="tag_title">Parameters:</p>
827
+ <ul class="param">
828
+
829
+ <li>
830
+
831
+ <span class='name'>profile</span>
832
+
833
+
834
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
835
+
836
+
837
+
838
+ &mdash;
839
+ <div class='inline'>
840
+ <p>The profile for which <span class='object_link'><a href="#read-instance_method" title="EdFi::Client#read (method)">#read</a></span> and <span class='object_link'><a href="#write-instance_method" title="EdFi::Client#write (method)">#write</a></span> will
841
+ generate headers.</p>
842
+ </div>
843
+
844
+ </li>
845
+
846
+ </ul>
847
+
848
+
849
+ </div><table class="source_code">
850
+ <tr>
851
+ <td>
852
+ <pre class="lines">
853
+
854
+
855
+ 63
856
+ 64
857
+ 65</pre>
858
+ </td>
859
+ <td>
860
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 63</span>
861
+
862
+ <span class='kw'>def</span> <span class='id identifier rubyid_profile='>profile=</span><span class='lparen'>(</span><span class='id identifier rubyid_profile'>profile</span><span class='rparen'>)</span>
863
+ <span class='ivar'>@profile</span> <span class='op'>=</span> <span class='id identifier rubyid_profile'>profile</span><span class='op'>&amp;.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='op'>&amp;.</span><span class='id identifier rubyid_downcase'>downcase</span>
864
+ <span class='kw'>end</span></pre>
865
+ </td>
866
+ </tr>
867
+ </table>
868
+ </div>
869
+
870
+ <div class="method_details ">
871
+ <h3 class="signature " id="put-instance_method">
872
+
873
+ #<strong>put</strong>(path, headers: {}, query: {}, payload: {}) &#x21d2; <tt>Object</tt>
874
+
875
+
876
+
877
+
878
+
879
+ </h3><div class="docstring">
880
+ <div class="discussion">
881
+
882
+ <p>CRUD method: PUT</p>
883
+
884
+ <p><em>headers</em>, <em>query</em>, and <em>payload</em> are preprocessed for
885
+ auth and case conversion, but all parameters are otherwise passed through
886
+ to Crapi::Proxy#put.</p>
887
+
888
+
889
+ </div>
890
+ </div>
891
+ <div class="tags">
892
+
893
+
894
+ </div><table class="source_code">
895
+ <tr>
896
+ <td>
897
+ <pre class="lines">
898
+
899
+
900
+ 161
901
+ 162
902
+ 163
903
+ 164</pre>
904
+ </td>
905
+ <td>
906
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 161</span>
907
+
908
+ <span class='kw'>def</span> <span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
909
+ <span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
910
+ <span class='id identifier rubyid_respond_with'>respond_with</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
911
+ <span class='kw'>end</span></pre>
912
+ </td>
913
+ </tr>
914
+ </table>
915
+ </div>
916
+
917
+ <div class="method_details ">
918
+ <h3 class="signature " id="read-instance_method">
919
+
920
+ #<strong>read</strong>(resource, as: nil) &#x21d2; <tt>HashWithIndifferentAccess</tt>
921
+
922
+
923
+
924
+
925
+
926
+ </h3><div class="docstring">
927
+ <div class="discussion">
928
+
929
+ <p>Returns the header needed to <span class='object_link'><a href="#get-instance_method" title="EdFi::Client#get (method)">#get</a></span> a resource with a profile.</p>
930
+
931
+
932
+ </div>
933
+ </div>
934
+ <div class="tags">
935
+ <p class="tag_title">Parameters:</p>
936
+ <ul class="param">
937
+
938
+ <li>
939
+
940
+ <span class='name'>resource</span>
941
+
942
+
943
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
944
+
945
+
946
+
947
+ &mdash;
948
+ <div class='inline'>
949
+ <p>The resource to be read.</p>
950
+ </div>
951
+
952
+ </li>
953
+
954
+ <li>
955
+
956
+ <span class='name'>as</span>
957
+
958
+
959
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
960
+
961
+
962
+
963
+ &mdash;
964
+ <div class='inline'>
965
+ <p>The profile to use. If one has already been set via
966
+ <span class='object_link'><a href="#initialize-instance_method" title="EdFi::Client#initialize (method)">#initialize</a></span> or <span class='object_link'><a href="#profile=-instance_method" title="EdFi::Client#profile= (method)">#profile=</a></span>, this value is
967
+ optional.</p>
968
+ </div>
969
+
970
+ </li>
971
+
972
+ </ul>
973
+
974
+ <p class="tag_title">Returns:</p>
975
+ <ul class="return">
976
+
977
+ <li>
978
+
979
+
980
+ <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span>
981
+
982
+
983
+
984
+ </li>
985
+
986
+ </ul>
987
+
988
+ </div><table class="source_code">
989
+ <tr>
990
+ <td>
991
+ <pre class="lines">
992
+
993
+
994
+ 82
995
+ 83
996
+ 84
997
+ 85
998
+ 86
999
+ 87</pre>
1000
+ </td>
1001
+ <td>
1002
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 82</span>
1003
+
1004
+ <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1005
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_profile'>profile</span> <span class='op'>=</span> <span class='id identifier rubyid_as'>as</span> <span class='kw'>if</span> <span class='id identifier rubyid_as'>as</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
1006
+ <span class='id identifier rubyid_mime_type'>mime_type</span> <span class='op'>=</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#PROFILE_MIME_TYPE-constant" title="EdFi::Client::PROFILE_MIME_TYPE (constant)">PROFILE_MIME_TYPE</a></span></span><span class='comma'>,</span> <span class='label'>resource:</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='label'>profile:</span> <span class='ivar'>@profile</span><span class='comma'>,</span> <span class='label'>access:</span> <span class='symbol'>:readable</span><span class='rparen'>)</span>
1007
+
1008
+ <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Accept</span><span class='label_end'>&#39;:</span> <span class='id identifier rubyid_mime_type'>mime_type</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span>
1009
+ <span class='kw'>end</span></pre>
1010
+ </td>
1011
+ </tr>
1012
+ </table>
1013
+ </div>
1014
+
1015
+ <div class="method_details ">
1016
+ <h3 class="signature " id="v2-instance_method">
1017
+
1018
+ #<strong>v2</strong>(period) &#x21d2; <tt><span class='object_link'><a href="Client/Proxy.html" title="EdFi::Client::Proxy (class)">EdFi::Client::Proxy</a></span></tt>
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+ </h3><div class="docstring">
1025
+ <div class="discussion">
1026
+
1027
+ <p>Convenience proxy generator for v2.0 API access, adding also the school
1028
+ year you&#39;d like to access.</p>
1029
+
1030
+ <p><code>v2(2017)</code>.)</p>
1031
+
1032
+
1033
+ </div>
1034
+ </div>
1035
+ <div class="tags">
1036
+ <p class="tag_title">Parameters:</p>
1037
+ <ul class="param">
1038
+
1039
+ <li>
1040
+
1041
+ <span class='name'>period</span>
1042
+
1043
+
1044
+ <span class='type'>(<tt>Integer</tt>)</span>
1045
+
1046
+
1047
+
1048
+ &mdash;
1049
+ <div class='inline'>
1050
+ <p>The school year to be accessed. (To access the v2.0 API for school year
1051
+ 2017-2018, call</p>
1052
+ </div>
1053
+
1054
+ </li>
1055
+
1056
+ </ul>
1057
+
1058
+ <p class="tag_title">Returns:</p>
1059
+ <ul class="return">
1060
+
1061
+ <li>
1062
+
1063
+
1064
+ <span class='type'>(<tt><span class='object_link'><a href="Client/Proxy.html" title="EdFi::Client::Proxy (class)">EdFi::Client::Proxy</a></span></tt>)</span>
1065
+
1066
+
1067
+
1068
+ </li>
1069
+
1070
+ </ul>
1071
+
1072
+ </div><table class="source_code">
1073
+ <tr>
1074
+ <td>
1075
+ <pre class="lines">
1076
+
1077
+
1078
+ 179
1079
+ 180
1080
+ 181</pre>
1081
+ </td>
1082
+ <td>
1083
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 179</span>
1084
+
1085
+ <span class='kw'>def</span> <span class='id identifier rubyid_v2'>v2</span><span class='lparen'>(</span><span class='id identifier rubyid_period'>period</span><span class='rparen'>)</span>
1086
+ <span class='ivar'>@v2</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../EdFi.html" title="EdFi (module)">EdFi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="EdFi::Client (class)">Client</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Client/Proxy.html" title="EdFi::Client::Proxy (class)">Proxy</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="EdFi::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>add:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/api/v2.0/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_period'>period</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>to:</span> <span class='kw'>self</span><span class='rparen'>)</span>
1087
+ <span class='kw'>end</span></pre>
1088
+ </td>
1089
+ </tr>
1090
+ </table>
1091
+ </div>
1092
+
1093
+ <div class="method_details ">
1094
+ <h3 class="signature " id="write-instance_method">
1095
+
1096
+ #<strong>write</strong>(resource, as: nil) &#x21d2; <tt>HashWithIndifferentAccess</tt>
1097
+
1098
+
1099
+
1100
+
1101
+
1102
+ </h3><div class="docstring">
1103
+ <div class="discussion">
1104
+
1105
+ <p>Returns the header needed to <span class='object_link'><a href="#delete-instance_method" title="EdFi::Client#delete (method)">#delete</a></span> / <span class='object_link'><a href="#patch-instance_method" title="EdFi::Client#patch (method)">#patch</a></span> /
1106
+ <span class='object_link'><a href="#post-instance_method" title="EdFi::Client#post (method)">#post</a></span> / <span class='object_link'><a href="#put-instance_method" title="EdFi::Client#put (method)">#put</a></span> a resource with a profile.</p>
1107
+
1108
+
1109
+ </div>
1110
+ </div>
1111
+ <div class="tags">
1112
+ <p class="tag_title">Parameters:</p>
1113
+ <ul class="param">
1114
+
1115
+ <li>
1116
+
1117
+ <span class='name'>resource</span>
1118
+
1119
+
1120
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
1121
+
1122
+
1123
+
1124
+ &mdash;
1125
+ <div class='inline'>
1126
+ <p>The resource to be written.</p>
1127
+ </div>
1128
+
1129
+ </li>
1130
+
1131
+ <li>
1132
+
1133
+ <span class='name'>as</span>
1134
+
1135
+
1136
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
1137
+
1138
+
1139
+
1140
+ &mdash;
1141
+ <div class='inline'>
1142
+ <p>The profile to use. If one has already been set via
1143
+ <span class='object_link'><a href="#initialize-instance_method" title="EdFi::Client#initialize (method)">#initialize</a></span> or <span class='object_link'><a href="#profile=-instance_method" title="EdFi::Client#profile= (method)">#profile=</a></span>, this value is
1144
+ optional.</p>
1145
+ </div>
1146
+
1147
+ </li>
1148
+
1149
+ </ul>
1150
+
1151
+ <p class="tag_title">Returns:</p>
1152
+ <ul class="return">
1153
+
1154
+ <li>
1155
+
1156
+
1157
+ <span class='type'>(<tt>HashWithIndifferentAccess</tt>)</span>
1158
+
1159
+
1160
+
1161
+ </li>
1162
+
1163
+ </ul>
1164
+
1165
+ </div><table class="source_code">
1166
+ <tr>
1167
+ <td>
1168
+ <pre class="lines">
1169
+
1170
+
1171
+ 106
1172
+ 107
1173
+ 108
1174
+ 109
1175
+ 110
1176
+ 111</pre>
1177
+ </td>
1178
+ <td>
1179
+ <pre class="code"><span class="info file"># File 'lib/ed_fi/client.rb', line 106</span>
1180
+
1181
+ <span class='kw'>def</span> <span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1182
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_profile'>profile</span> <span class='op'>=</span> <span class='id identifier rubyid_as'>as</span> <span class='kw'>if</span> <span class='id identifier rubyid_as'>as</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
1183
+ <span class='id identifier rubyid_mime_type'>mime_type</span> <span class='op'>=</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#PROFILE_MIME_TYPE-constant" title="EdFi::Client::PROFILE_MIME_TYPE (constant)">PROFILE_MIME_TYPE</a></span></span><span class='comma'>,</span> <span class='label'>resource:</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='label'>profile:</span> <span class='ivar'>@profile</span><span class='comma'>,</span> <span class='label'>access:</span> <span class='symbol'>:writable</span><span class='rparen'>)</span>
1184
+
1185
+ <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='label_end'>&#39;:</span> <span class='id identifier rubyid_mime_type'>mime_type</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span>
1186
+ <span class='kw'>end</span></pre>
1187
+ </td>
1188
+ </tr>
1189
+ </table>
1190
+ </div>
1191
+
1192
+ </div>
1193
+
1194
+ </div>
1195
+
1196
+ <div id="footer">
1197
+ Generated on Thu May 24 18:35:38 2018 by
1198
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1199
+ 0.9.12 (ruby-2.5.1).
1200
+ </div>
1201
+
1202
+ </div>
1203
+ </body>
1204
+ </html>