absorb_api 0.2.0 → 0.9.1
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +866 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +46 -0
- data/Gemfile +3 -10
- data/README.md +0 -2
- data/Rakefile +3 -1
- data/absorb_api.gemspec +30 -16
- data/bin/console +11 -5
- data/doc/AbsorbApi.html +33 -64
- data/doc/AbsorbApi/Api.html +358 -0
- data/doc/AbsorbApi/Authorize.html +263 -0
- data/doc/AbsorbApi/Category.html +3 -2
- data/doc/AbsorbApi/Certificate.html +3 -2
- data/doc/AbsorbApi/Chapter.html +3 -2
- data/doc/AbsorbApi/Collection.html +3 -2
- data/doc/AbsorbApi/Configuration.html +3 -28
- data/doc/AbsorbApi/Course.html +3 -71
- data/doc/AbsorbApi/CourseEnrollment.html +6 -58
- data/doc/AbsorbApi/Create.html +164 -0
- data/doc/AbsorbApi/Curriculum.html +3 -2
- data/doc/AbsorbApi/Department.html +4 -14
- data/doc/AbsorbApi/Lesson.html +3 -2
- data/doc/AbsorbApi/LessonEnrollment.html +3 -2
- data/doc/AbsorbApi/Prerequisite.html +3 -2
- data/doc/AbsorbApi/Record.html +360 -0
- data/doc/AbsorbApi/Relations.html +2 -196
- data/doc/AbsorbApi/Relations/ClassMethods.html +197 -0
- data/doc/AbsorbApi/Resource.html +3 -2
- data/doc/AbsorbApi/ResourceNotFound.html +2 -1
- data/doc/AbsorbApi/Role.html +3 -2
- data/doc/AbsorbApi/RouteNotFound.html +2 -1
- data/doc/AbsorbApi/SessionSchedule.html +3 -2
- data/doc/AbsorbApi/Tag.html +4 -14
- data/doc/AbsorbApi/User.html +85 -35
- data/doc/AbsorbApi/ValidationError.html +2 -1
- data/doc/AbsorbApi/Where.html +162 -0
- data/doc/CODE_OF_CONDUCT_md.html +196 -0
- data/doc/Gemfile.html +8 -8
- data/doc/Gemfile_lock.html +57 -29
- data/doc/Icon/r.html +96 -0
- data/doc/LICENSE_txt.html +6 -1
- data/doc/Object.html +159 -0
- data/doc/README_md.html +6 -3
- data/doc/Rakefile.html +7 -2
- data/doc/absorb_api_gemspec.html +24 -7
- data/doc/bin/setup.html +6 -1
- data/doc/created.rid +34 -30
- data/doc/css/fonts.css +6 -6
- data/doc/index.html +19 -4
- data/doc/js/darkfish.js +7 -7
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +1 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +118 -31
- data/lib/absorb_api.rb +43 -29
- data/lib/absorb_api/api.rb +69 -5
- data/lib/absorb_api/authorize.rb +37 -7
- data/lib/absorb_api/category.rb +3 -1
- data/lib/absorb_api/certificate.rb +5 -2
- data/lib/absorb_api/chapter.rb +3 -1
- data/lib/absorb_api/collection.rb +2 -19
- data/lib/absorb_api/configuration.rb +14 -12
- data/lib/absorb_api/course.rb +11 -25
- data/lib/absorb_api/course_enrollment.rb +13 -26
- data/lib/absorb_api/create.rb +19 -0
- data/lib/absorb_api/curriculum.rb +11 -2
- data/lib/absorb_api/department.rb +10 -4
- data/lib/absorb_api/lesson.rb +5 -2
- data/lib/absorb_api/lesson_enrollment.rb +8 -2
- data/lib/absorb_api/prerequisite.rb +5 -2
- data/lib/absorb_api/record.rb +58 -0
- data/lib/absorb_api/relations.rb +42 -40
- data/lib/absorb_api/resource.rb +3 -1
- data/lib/absorb_api/role.rb +3 -1
- data/lib/absorb_api/session_schedule.rb +6 -2
- data/lib/absorb_api/tag.rb +6 -3
- data/lib/absorb_api/user.rb +13 -29
- data/lib/absorb_api/version.rb +3 -1
- data/lib/absorb_api/where.rb +17 -0
- metadata +133 -8
- data/lib/absorb_api/base.rb +0 -12
- data/lib/absorb_api/orm.rb +0 -36
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -58,7 +59,7 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"
|
62
|
+
<p class="link">Record
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
@@ -70,8 +71,6 @@
|
|
70
71
|
|
71
72
|
<ul class="link-list" role="directory">
|
72
73
|
|
73
|
-
<li ><a href="#method-c-lessons_from_collection">::lessons_from_collection</a>
|
74
|
-
|
75
74
|
<li ><a href="#method-i-lessons">#lessons</a>
|
76
75
|
|
77
76
|
</ul>
|
@@ -318,57 +317,6 @@
|
|
318
317
|
|
319
318
|
|
320
319
|
|
321
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
322
|
-
<header>
|
323
|
-
<h3>Public Class Methods</h3>
|
324
|
-
</header>
|
325
|
-
|
326
|
-
|
327
|
-
<div id="method-c-lessons_from_collection" class="method-detail ">
|
328
|
-
|
329
|
-
<div class="method-heading">
|
330
|
-
<span class="method-name">lessons_from_collection</span><span
|
331
|
-
class="method-args">(course_enrollments, **filters)</span>
|
332
|
-
|
333
|
-
<span class="method-click-advice">click to toggle source</span>
|
334
|
-
|
335
|
-
</div>
|
336
|
-
|
337
|
-
|
338
|
-
<div class="method-description">
|
339
|
-
|
340
|
-
<p>gets all associated lessons given a collection of enrollments all calls are
|
341
|
-
called in parallel enrollments are chunked in groups of 105 to keep
|
342
|
-
typhoeus from getting bogged down modifiedSince must be a DateTime object</p>
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
<div class="method-source-code" id="lessons_from_collection-source">
|
348
|
-
<pre><span class="ruby-comment"># File lib/absorb_api/course_enrollment.rb, line 15</span>
|
349
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">lessons_from_collection</span>(<span class="ruby-identifier">course_enrollments</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">filters</span>)
|
350
|
-
<span class="ruby-identifier">lessons</span> = []
|
351
|
-
<span class="ruby-identifier">course_enrollments</span>.<span class="ruby-identifier">each_slice</span>(<span class="ruby-value">105</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">enrollment_slice</span><span class="ruby-operator">|</span>
|
352
|
-
<span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">api</span>.<span class="ruby-identifier">in_parallel</span> <span class="ruby-keyword">do</span>
|
353
|
-
<span class="ruby-identifier">enrollment_slice</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">enrollment</span><span class="ruby-operator">|</span>
|
354
|
-
<span class="ruby-identifier">lessons</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">api</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">"users/#{enrollment.user_id}/enrollments/#{enrollment.course_id}/lessons"</span>, <span class="ruby-identifier">filters</span>)
|
355
|
-
<span class="ruby-keyword">end</span>
|
356
|
-
<span class="ruby-keyword">end</span>
|
357
|
-
<span class="ruby-keyword">end</span>
|
358
|
-
<span class="ruby-identifier">lessons</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">response</span><span class="ruby-operator">|</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">body</span><span class="ruby-operator">|</span> <span class="ruby-constant">LessonEnrollment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">body</span>) } }.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">lesson</span><span class="ruby-operator">|</span> <span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ignored_lesson_types</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">lesson</span>.<span class="ruby-identifier">type</span> }
|
359
|
-
<span class="ruby-keyword">end</span></pre>
|
360
|
-
</div>
|
361
|
-
|
362
|
-
</div>
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
</div>
|
368
|
-
|
369
|
-
|
370
|
-
</section>
|
371
|
-
|
372
320
|
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
373
321
|
<header>
|
374
322
|
<h3>Public Instance Methods</h3>
|
@@ -394,10 +342,10 @@ typhoeus from getting bogged down modifiedSince must be a DateTime object</p>
|
|
394
342
|
|
395
343
|
|
396
344
|
<div class="method-source-code" id="lessons-source">
|
397
|
-
<pre><span class="ruby-comment"># File lib/absorb_api/course_enrollment.rb, line
|
345
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/course_enrollment.rb, line 9</span>
|
398
346
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">lessons</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">conditions</span>)
|
399
|
-
<span class="ruby-
|
400
|
-
<span class="ruby-constant">LessonEnrollment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">
|
347
|
+
<span class="ruby-identifier">get</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">conditions</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">ignore_resource_not_found</span><span class="ruby-operator">:</span> <span class="ruby-keyword">true</span>)).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attrs</span><span class="ruby-operator">|</span>
|
348
|
+
<span class="ruby-constant">LessonEnrollment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">attrs</span>)
|
401
349
|
<span class="ruby-keyword">end</span>
|
402
350
|
<span class="ruby-keyword">end</span></pre>
|
403
351
|
</div>
|
@@ -418,7 +366,7 @@ typhoeus from getting bogged down modifiedSince must be a DateTime object</p>
|
|
418
366
|
|
419
367
|
<footer id="validator-badges" role="contentinfo">
|
420
368
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
421
|
-
<p>Generated by <a href="
|
369
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
422
370
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
423
371
|
</footer>
|
424
372
|
|
@@ -0,0 +1,164 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module AbsorbApi::Create - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/jquery.js"></script>
|
15
|
+
<script src="../js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="module">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="../index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<div id="extends-section" class="nav-section">
|
61
|
+
<h3>Extended With Modules</h3>
|
62
|
+
|
63
|
+
<ul class="link-list">
|
64
|
+
|
65
|
+
|
66
|
+
<li><span class="extend">ActiveSupport::Concern</span>
|
67
|
+
|
68
|
+
|
69
|
+
</ul>
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<!-- Method Quickref -->
|
73
|
+
<div id="method-list-section" class="nav-section">
|
74
|
+
<h3>Methods</h3>
|
75
|
+
|
76
|
+
<ul class="link-list" role="directory">
|
77
|
+
|
78
|
+
<li ><a href="#method-i-create">#create</a>
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
</nav>
|
85
|
+
|
86
|
+
<main role="main" aria-labelledby="module-AbsorbApi::Create">
|
87
|
+
<h1 id="module-AbsorbApi::Create" class="module">
|
88
|
+
module AbsorbApi::Create
|
89
|
+
</h1>
|
90
|
+
|
91
|
+
<section class="description">
|
92
|
+
|
93
|
+
</section>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
109
|
+
<header>
|
110
|
+
<h3>Public Instance Methods</h3>
|
111
|
+
</header>
|
112
|
+
|
113
|
+
|
114
|
+
<div id="method-i-create" class="method-detail ">
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
<span class="method-name">create</span><span
|
118
|
+
class="method-args">(attributes = {}) { |object| ... }</span>
|
119
|
+
|
120
|
+
<span class="method-click-advice">click to toggle source</span>
|
121
|
+
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
<div class="method-description">
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<div class="method-source-code" id="create-source">
|
133
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/create.rb, line 7</span>
|
134
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-identifier">attributes</span> = {})
|
135
|
+
<span class="ruby-identifier">object</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">attributes</span>)
|
136
|
+
<span class="ruby-keyword">yield</span>(<span class="ruby-identifier">object</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
|
137
|
+
|
138
|
+
<span class="ruby-identifier">attrs</span> = <span class="ruby-identifier">object</span>.<span class="ruby-identifier">as_json</span>.<span class="ruby-identifier">transform_keys</span>(<span class="ruby-operator">&</span><span class="ruby-value">:camelize</span>)
|
139
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">demodulize</span>.<span class="ruby-identifier">pluralize</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">attrs</span>)
|
140
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">id</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>[<span class="ruby-string">"Id"</span>]
|
141
|
+
<span class="ruby-identifier">object</span>
|
142
|
+
<span class="ruby-keyword">end</span></pre>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
</div>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
</section>
|
154
|
+
|
155
|
+
</section>
|
156
|
+
</main>
|
157
|
+
|
158
|
+
|
159
|
+
<footer id="validator-badges" role="contentinfo">
|
160
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
161
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
162
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
163
|
+
</footer>
|
164
|
+
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -58,7 +59,7 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"
|
62
|
+
<p class="link">Record
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
@@ -481,7 +482,7 @@
|
|
481
482
|
|
482
483
|
<footer id="validator-badges" role="contentinfo">
|
483
484
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
484
|
-
<p>Generated by <a href="
|
485
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
485
486
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
486
487
|
</footer>
|
487
488
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -58,22 +59,11 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"
|
62
|
+
<p class="link">Record
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
65
|
-
|
66
|
-
<h3>Included Modules</h3>
|
67
|
-
|
68
|
-
<ul class="link-list">
|
69
|
-
|
70
|
-
|
71
|
-
<li><a class="include" href="Relations.html">AbsorbApi::Relations</a>
|
72
|
-
|
73
|
-
|
74
|
-
</ul>
|
75
|
-
</div>
|
76
|
-
|
66
|
+
|
77
67
|
|
78
68
|
|
79
69
|
</div>
|
@@ -232,7 +222,7 @@
|
|
232
222
|
|
233
223
|
<footer id="validator-badges" role="contentinfo">
|
234
224
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
235
|
-
<p>Generated by <a href="
|
225
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
236
226
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
237
227
|
</footer>
|
238
228
|
|
data/doc/AbsorbApi/Lesson.html
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -58,7 +59,7 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"
|
62
|
+
<p class="link">Record
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
@@ -273,7 +274,7 @@
|
|
273
274
|
|
274
275
|
<footer id="validator-badges" role="contentinfo">
|
275
276
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
276
|
-
<p>Generated by <a href="
|
277
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
277
278
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
278
279
|
</footer>
|
279
280
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -58,7 +59,7 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"
|
62
|
+
<p class="link">Record
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
@@ -364,7 +365,7 @@
|
|
364
365
|
|
365
366
|
<footer id="validator-badges" role="contentinfo">
|
366
367
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
367
|
-
<p>Generated by <a href="
|
368
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
368
369
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
369
370
|
</footer>
|
370
371
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -58,7 +59,7 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"
|
62
|
+
<p class="link">Record
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
@@ -182,7 +183,7 @@
|
|
182
183
|
|
183
184
|
<footer id="validator-badges" role="contentinfo">
|
184
185
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
185
|
-
<p>Generated by <a href="
|
186
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
186
187
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
187
188
|
</footer>
|
188
189
|
|
@@ -0,0 +1,360 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class AbsorbApi::Record - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/jquery.js"></script>
|
15
|
+
<script src="../js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="class">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="../index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
<div id="parent-class-section" class="nav-section">
|
59
|
+
<h3>Parent</h3>
|
60
|
+
|
61
|
+
|
62
|
+
<p class="link"><a href="../Object.html">Object</a>
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<div id="includes-section" class="nav-section">
|
67
|
+
<h3>Included Modules</h3>
|
68
|
+
|
69
|
+
<ul class="link-list">
|
70
|
+
|
71
|
+
|
72
|
+
<li><a class="include" href="Relations.html">AbsorbApi::Relations</a>
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<li><a class="include" href="Create.html">AbsorbApi::Create</a>
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<li><a class="include" href="Where.html">AbsorbApi::Where</a>
|
81
|
+
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
<!-- Method Quickref -->
|
88
|
+
<div id="method-list-section" class="nav-section">
|
89
|
+
<h3>Methods</h3>
|
90
|
+
|
91
|
+
<ul class="link-list" role="directory">
|
92
|
+
|
93
|
+
<li ><a href="#method-c-all">::all</a>
|
94
|
+
|
95
|
+
<li ><a href="#method-c-can_create">::can_create</a>
|
96
|
+
|
97
|
+
<li ><a href="#method-c-can_search">::can_search</a>
|
98
|
+
|
99
|
+
<li ><a href="#method-c-find">::find</a>
|
100
|
+
|
101
|
+
<li ><a href="#method-c-new">::new</a>
|
102
|
+
|
103
|
+
<li ><a href="#method-c-with_relationships">::with_relationships</a>
|
104
|
+
|
105
|
+
</ul>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</nav>
|
110
|
+
|
111
|
+
<main role="main" aria-labelledby="class-AbsorbApi::Record">
|
112
|
+
<h1 id="class-AbsorbApi::Record" class="class">
|
113
|
+
class AbsorbApi::Record
|
114
|
+
</h1>
|
115
|
+
|
116
|
+
<section class="description">
|
117
|
+
|
118
|
+
</section>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
134
|
+
<header>
|
135
|
+
<h3>Public Class Methods</h3>
|
136
|
+
</header>
|
137
|
+
|
138
|
+
|
139
|
+
<div id="method-c-all" class="method-detail ">
|
140
|
+
|
141
|
+
<div class="method-heading">
|
142
|
+
<span class="method-name">all</span><span
|
143
|
+
class="method-args">()</span>
|
144
|
+
|
145
|
+
<span class="method-click-advice">click to toggle source</span>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
|
150
|
+
<div class="method-description">
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<div class="method-source-code" id="all-source">
|
158
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/record.rb, line 24</span>
|
159
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">all</span>
|
160
|
+
<span class="ruby-identifier">objs</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">demodulize</span>.<span class="ruby-identifier">pluralize</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attrs</span><span class="ruby-operator">|</span>
|
161
|
+
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">attrs</span>)
|
162
|
+
<span class="ruby-keyword">end</span>
|
163
|
+
|
164
|
+
<span class="ruby-constant">Collection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">objs</span>, <span class="ruby-identifier">klass</span><span class="ruby-operator">:</span> <span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">demodulize</span>)
|
165
|
+
<span class="ruby-keyword">end</span></pre>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</div>
|
174
|
+
|
175
|
+
|
176
|
+
<div id="method-c-can_create" class="method-detail ">
|
177
|
+
|
178
|
+
<div class="method-heading">
|
179
|
+
<span class="method-name">can_create</span><span
|
180
|
+
class="method-args">()</span>
|
181
|
+
|
182
|
+
<span class="method-click-advice">click to toggle source</span>
|
183
|
+
|
184
|
+
</div>
|
185
|
+
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
<div class="method-source-code" id="can_create-source">
|
195
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/record.rb, line 36</span>
|
196
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">can_create</span>
|
197
|
+
<span class="ruby-identifier">include</span> <span class="ruby-constant">Create</span>
|
198
|
+
<span class="ruby-keyword">end</span></pre>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
</div>
|
207
|
+
|
208
|
+
|
209
|
+
<div id="method-c-can_search" class="method-detail ">
|
210
|
+
|
211
|
+
<div class="method-heading">
|
212
|
+
<span class="method-name">can_search</span><span
|
213
|
+
class="method-args">()</span>
|
214
|
+
|
215
|
+
<span class="method-click-advice">click to toggle source</span>
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
|
220
|
+
<div class="method-description">
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<div class="method-source-code" id="can_search-source">
|
228
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/record.rb, line 40</span>
|
229
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">can_search</span>
|
230
|
+
<span class="ruby-identifier">include</span> <span class="ruby-constant">Where</span>
|
231
|
+
<span class="ruby-keyword">end</span></pre>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
</div>
|
240
|
+
|
241
|
+
|
242
|
+
<div id="method-c-find" class="method-detail ">
|
243
|
+
|
244
|
+
<div class="method-heading">
|
245
|
+
<span class="method-name">find</span><span
|
246
|
+
class="method-args">(id)</span>
|
247
|
+
|
248
|
+
<span class="method-click-advice">click to toggle source</span>
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
|
253
|
+
<div class="method-description">
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<div class="method-source-code" id="find-source">
|
261
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/record.rb, line 18</span>
|
262
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">id</span>)
|
263
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ResourceNotFound</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span>.<span class="ruby-identifier">blank?</span>
|
264
|
+
|
265
|
+
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">"#{to_s.demodulize.pluralize}/#{id}"</span>))
|
266
|
+
<span class="ruby-keyword">end</span></pre>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
</div>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
</div>
|
275
|
+
|
276
|
+
|
277
|
+
<div id="method-c-new" class="method-detail ">
|
278
|
+
|
279
|
+
<div class="method-heading">
|
280
|
+
<span class="method-name">new</span><span
|
281
|
+
class="method-args">(params = {}) { |self| ... }</span>
|
282
|
+
|
283
|
+
<span class="method-click-advice">click to toggle source</span>
|
284
|
+
|
285
|
+
</div>
|
286
|
+
|
287
|
+
|
288
|
+
<div class="method-description">
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
<div class="method-source-code" id="new-source">
|
296
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/record.rb, line 7</span>
|
297
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span> = {})
|
298
|
+
<span class="ruby-identifier">params</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
299
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">"#{attr.to_s.underscore}="</span>)
|
300
|
+
|
301
|
+
<span class="ruby-identifier">public_send</span>(<span class="ruby-node">"#{attr.to_s.underscore}="</span>, <span class="ruby-identifier">value</span>)
|
302
|
+
<span class="ruby-keyword">end</span>
|
303
|
+
|
304
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
|
305
|
+
<span class="ruby-keyword">end</span></pre>
|
306
|
+
</div>
|
307
|
+
|
308
|
+
</div>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
</div>
|
314
|
+
|
315
|
+
|
316
|
+
<div id="method-c-with_relationships" class="method-detail ">
|
317
|
+
|
318
|
+
<div class="method-heading">
|
319
|
+
<span class="method-name">with_relationships</span><span
|
320
|
+
class="method-args">()</span>
|
321
|
+
|
322
|
+
<span class="method-click-advice">click to toggle source</span>
|
323
|
+
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
<div class="method-description">
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
<div class="method-source-code" id="with_relationships-source">
|
335
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/record.rb, line 32</span>
|
336
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_relationships</span>
|
337
|
+
<span class="ruby-identifier">include</span> <span class="ruby-constant">Relations</span>
|
338
|
+
<span class="ruby-keyword">end</span></pre>
|
339
|
+
</div>
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
</div>
|
347
|
+
|
348
|
+
|
349
|
+
</section>
|
350
|
+
|
351
|
+
</section>
|
352
|
+
</main>
|
353
|
+
|
354
|
+
|
355
|
+
<footer id="validator-badges" role="contentinfo">
|
356
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
357
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
358
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
359
|
+
</footer>
|
360
|
+
|