absorb_api 0.2.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/doc/AbsorbApi/Role.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"><a href="
|
62
|
+
<p class="link"><a href="Record.html">AbsorbApi::Record</a>
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
@@ -143,7 +144,7 @@
|
|
143
144
|
|
144
145
|
<footer id="validator-badges" role="contentinfo">
|
145
146
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
146
|
-
<p>Generated by <a href="
|
147
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
147
148
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
148
149
|
</footer>
|
149
150
|
|
@@ -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>
|
@@ -96,7 +97,7 @@
|
|
96
97
|
|
97
98
|
<footer id="validator-badges" role="contentinfo">
|
98
99
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
99
|
-
<p>Generated by <a href="
|
100
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
100
101
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
101
102
|
</footer>
|
102
103
|
|
@@ -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"><a href="
|
62
|
+
<p class="link"><a href="Record.html">AbsorbApi::Record</a>
|
62
63
|
|
63
64
|
</div>
|
64
65
|
|
@@ -247,7 +248,7 @@
|
|
247
248
|
|
248
249
|
<footer id="validator-badges" role="contentinfo">
|
249
250
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
250
|
-
<p>Generated by <a href="
|
251
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
251
252
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
252
253
|
</footer>
|
253
254
|
|
data/doc/AbsorbApi/Tag.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,22 +59,11 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"><a href="
|
62
|
+
<p class="link"><a href="Record.html">AbsorbApi::Record</a>
|
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>
|
@@ -141,7 +131,7 @@
|
|
141
131
|
|
142
132
|
<footer id="validator-badges" role="contentinfo">
|
143
133
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
144
|
-
<p>Generated by <a href="
|
134
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
145
135
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
146
136
|
</footer>
|
147
137
|
|
data/doc/AbsorbApi/User.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,22 +59,11 @@
|
|
58
59
|
<h3>Parent</h3>
|
59
60
|
|
60
61
|
|
61
|
-
<p class="link"><a href="
|
62
|
+
<p class="link"><a href="Record.html">AbsorbApi::Record</a>
|
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
|
<!-- Method Quickref -->
|
79
69
|
<div id="method-list-section" class="nav-section">
|
@@ -81,7 +71,7 @@
|
|
81
71
|
|
82
72
|
<ul class="link-list" role="directory">
|
83
73
|
|
84
|
-
<li ><a href="#method-
|
74
|
+
<li ><a href="#method-i-update">#update</a>
|
85
75
|
|
86
76
|
</ul>
|
87
77
|
</div>
|
@@ -229,6 +219,45 @@
|
|
229
219
|
|
230
220
|
|
231
221
|
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div id="attribute-i-decimal1" class="method-detail">
|
226
|
+
<div class="method-heading attribute-method-heading">
|
227
|
+
<span class="method-name">decimal1</span><span
|
228
|
+
class="attribute-access-type">[RW]</span>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div class="method-description">
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div id="attribute-i-decimal2" class="method-detail">
|
239
|
+
<div class="method-heading attribute-method-heading">
|
240
|
+
<span class="method-name">decimal2</span><span
|
241
|
+
class="attribute-access-type">[RW]</span>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<div id="attribute-i-decimal3" class="method-detail">
|
252
|
+
<div class="method-heading attribute-method-heading">
|
253
|
+
<span class="method-name">decimal3</span><span
|
254
|
+
class="attribute-access-type">[RW]</span>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<div class="method-description">
|
258
|
+
|
259
|
+
|
260
|
+
|
232
261
|
</div>
|
233
262
|
</div>
|
234
263
|
|
@@ -515,6 +544,32 @@
|
|
515
544
|
|
516
545
|
|
517
546
|
|
547
|
+
</div>
|
548
|
+
</div>
|
549
|
+
|
550
|
+
<div id="attribute-i-string1" class="method-detail">
|
551
|
+
<div class="method-heading attribute-method-heading">
|
552
|
+
<span class="method-name">string1</span><span
|
553
|
+
class="attribute-access-type">[RW]</span>
|
554
|
+
</div>
|
555
|
+
|
556
|
+
<div class="method-description">
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
</div>
|
561
|
+
</div>
|
562
|
+
|
563
|
+
<div id="attribute-i-string2" class="method-detail">
|
564
|
+
<div class="method-heading attribute-method-heading">
|
565
|
+
<span class="method-name">string2</span><span
|
566
|
+
class="attribute-access-type">[RW]</span>
|
567
|
+
</div>
|
568
|
+
|
569
|
+
<div class="method-description">
|
570
|
+
|
571
|
+
|
572
|
+
|
518
573
|
</div>
|
519
574
|
</div>
|
520
575
|
|
@@ -548,17 +603,17 @@
|
|
548
603
|
|
549
604
|
|
550
605
|
|
551
|
-
<section id="public-
|
606
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
552
607
|
<header>
|
553
|
-
<h3>Public
|
608
|
+
<h3>Public Instance Methods</h3>
|
554
609
|
</header>
|
555
610
|
|
556
611
|
|
557
|
-
<div id="method-
|
612
|
+
<div id="method-i-update" class="method-detail ">
|
558
613
|
|
559
614
|
<div class="method-heading">
|
560
|
-
<span class="method-name">
|
561
|
-
class="method-args">(
|
615
|
+
<span class="method-name">update</span><span
|
616
|
+
class="method-args">(attrs)</span>
|
562
617
|
|
563
618
|
<span class="method-click-advice">click to toggle source</span>
|
564
619
|
|
@@ -567,25 +622,20 @@
|
|
567
622
|
|
568
623
|
<div class="method-description">
|
569
624
|
|
570
|
-
|
571
|
-
called in parallel users are chunked in groups of 105 to keep typhoeus from
|
572
|
-
getting bogged down</p>
|
625
|
+
|
573
626
|
|
574
627
|
|
575
628
|
|
576
629
|
|
577
|
-
<div class="method-source-code" id="
|
578
|
-
<pre><span class="ruby-comment"># File lib/absorb_api/user.rb, line
|
579
|
-
<span class="ruby-keyword">def</span> <span class="ruby-
|
580
|
-
<span class="ruby-identifier">
|
581
|
-
<span class="ruby-identifier">
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
<span class="ruby-keyword">end</span>
|
587
|
-
<span class="ruby-keyword">end</span>
|
588
|
-
<span class="ruby-identifier">courses</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">Course</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">body</span>) } }.<span class="ruby-identifier">flatten</span>
|
630
|
+
<div class="method-source-code" id="update-source">
|
631
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/user.rb, line 23</span>
|
632
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">attrs</span>)
|
633
|
+
<span class="ruby-identifier">attrs</span> = <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">with_indifferent_access</span>.<span class="ruby-identifier">transform_keys</span>(<span class="ruby-operator">&</span><span class="ruby-value">:camelize</span>)
|
634
|
+
<span class="ruby-identifier">attrs</span>[<span class="ruby-string">"Username"</span>] = <span class="ruby-identifier">username</span>
|
635
|
+
|
636
|
+
<span class="ruby-identifier">put</span>(<span class="ruby-node">"users/#{id}"</span>, <span class="ruby-identifier">attrs</span>)
|
637
|
+
|
638
|
+
<span class="ruby-keyword">self</span>
|
589
639
|
<span class="ruby-keyword">end</span></pre>
|
590
640
|
</div>
|
591
641
|
|
@@ -605,7 +655,7 @@ getting bogged down</p>
|
|
605
655
|
|
606
656
|
<footer id="validator-badges" role="contentinfo">
|
607
657
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
608
|
-
<p>Generated by <a href="
|
658
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
609
659
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
610
660
|
</footer>
|
611
661
|
|
@@ -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>
|
@@ -96,7 +97,7 @@
|
|
96
97
|
|
97
98
|
<footer id="validator-badges" role="contentinfo">
|
98
99
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
99
|
-
<p>Generated by <a href="
|
100
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
100
101
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
101
102
|
</footer>
|
102
103
|
|
@@ -0,0 +1,162 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module AbsorbApi::Where - 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-where">#where</a>
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
</nav>
|
85
|
+
|
86
|
+
<main role="main" aria-labelledby="module-AbsorbApi::Where">
|
87
|
+
<h1 id="module-AbsorbApi::Where" class="module">
|
88
|
+
module AbsorbApi::Where
|
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-where" class="method-detail ">
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
<span class="method-name">where</span><span
|
118
|
+
class="method-args">(**conditions)</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="where-source">
|
133
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/where.rb, line 7</span>
|
134
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">where</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">conditions</span>)
|
135
|
+
<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">conditions</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>
|
136
|
+
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">attrs</span>)
|
137
|
+
<span class="ruby-keyword">end</span>
|
138
|
+
|
139
|
+
<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>)
|
140
|
+
<span class="ruby-keyword">end</span></pre>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</div>
|
149
|
+
|
150
|
+
|
151
|
+
</section>
|
152
|
+
|
153
|
+
</section>
|
154
|
+
</main>
|
155
|
+
|
156
|
+
|
157
|
+
<footer id="validator-badges" role="contentinfo">
|
158
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
159
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
160
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
161
|
+
</footer>
|
162
|
+
|