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/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.1
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
## Our Standards
|
8
|
+
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
10
|
+
|
11
|
+
* Using welcoming and inclusive language
|
12
|
+
* Being respectful of differing viewpoints and experiences
|
13
|
+
* Gracefully accepting constructive criticism
|
14
|
+
* Focusing on what is best for the community
|
15
|
+
* Showing empathy towards other community members
|
16
|
+
|
17
|
+
Examples of unacceptable behavior by participants include:
|
18
|
+
|
19
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
20
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
21
|
+
* Public or private harassment
|
22
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
23
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
24
|
+
|
25
|
+
## Our Responsibilities
|
26
|
+
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
28
|
+
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
30
|
+
|
31
|
+
## Scope
|
32
|
+
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
34
|
+
|
35
|
+
## Enforcement
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at npezza93@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
38
|
+
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
40
|
+
|
41
|
+
## Attribution
|
42
|
+
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
44
|
+
|
45
|
+
[homepage]: http://contributor-covenant.org
|
46
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
@@ -1,12 +1,5 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
gemspec
|
3
|
+
source "https://rubygems.org"
|
5
4
|
|
6
|
-
|
7
|
-
gem 'typhoeus'
|
8
|
-
gem 'json'
|
9
|
-
gem 'faraday_middleware'
|
10
|
-
gem 'activesupport'
|
11
|
-
gem 'activemodel'
|
12
|
-
gem 'pry'
|
5
|
+
gemspec
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/absorb_api.gemspec
CHANGED
@@ -1,24 +1,38 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
5
|
+
|
6
|
+
require "absorb_api/version"
|
5
7
|
|
6
8
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
9
|
+
spec.name = "absorb_api"
|
8
10
|
spec.version = AbsorbApi::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
+
spec.authors = ["npezza"]
|
12
|
+
spec.email = ["npezza93@gmail.com"]
|
13
|
+
|
14
|
+
spec.summary = "API wrapper for Absorb LMS"
|
15
|
+
spec.description = "This gem provides a ruby wrapper for Absorb's Learning"\
|
16
|
+
"Management System API."
|
17
|
+
spec.homepage = "https://github.com/npezza93/absorb_api"
|
18
|
+
spec.license = "MIT"
|
19
|
+
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
21
|
+
f.match(%r{^(test|spec|features)/})
|
22
|
+
end
|
11
23
|
|
12
|
-
spec.
|
13
|
-
spec.
|
14
|
-
spec.homepage = 'https://github.com/npezza93/absorb_api'
|
15
|
-
spec.license = 'MIT'
|
24
|
+
spec.bindir = "bin"
|
25
|
+
spec.require_paths = ["lib"]
|
16
26
|
|
17
|
-
spec.
|
18
|
-
spec.
|
19
|
-
spec.
|
20
|
-
spec.
|
27
|
+
spec.add_dependency "activemodel"
|
28
|
+
spec.add_dependency "activesupport"
|
29
|
+
spec.add_dependency "faraday"
|
30
|
+
spec.add_dependency "faraday_middleware"
|
31
|
+
spec.add_dependency "json"
|
32
|
+
spec.add_dependency "typhoeus"
|
21
33
|
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
34
|
+
spec.add_development_dependency "pry"
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "rubocop"
|
24
38
|
end
|
data/bin/console
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require "bundler/setup"
|
4
5
|
require "absorb_api"
|
@@ -6,9 +7,14 @@ require "absorb_api"
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
def reload!(print = true)
|
11
|
+
puts "Reloading..." if print
|
12
|
+
files = $LOADED_FEATURES.select do |feat|
|
13
|
+
feat =~ /\/absorb_api\// && feat.exclude?("version")
|
14
|
+
end
|
15
|
+
files.each { |file| load file }
|
16
|
+
true
|
17
|
+
end
|
12
18
|
|
13
|
-
require "
|
14
|
-
|
19
|
+
require "pry"
|
20
|
+
Pry.start
|
data/doc/AbsorbApi.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>
|
@@ -63,14 +64,14 @@
|
|
63
64
|
|
64
65
|
<ul class="link-list" role="directory">
|
65
66
|
|
66
|
-
<li ><a href="#method-c-
|
67
|
-
|
68
|
-
<li ><a href="#method-c-authorize">::authorize</a>
|
67
|
+
<li ><a href="#method-c-configuration">::configuration</a>
|
69
68
|
|
70
69
|
<li ><a href="#method-c-configure">::configure</a>
|
71
70
|
|
72
71
|
<li ><a href="#method-c-reset">::reset</a>
|
73
72
|
|
73
|
+
<li ><a href="#method-c-token">::token</a>
|
74
|
+
|
74
75
|
</ul>
|
75
76
|
</div>
|
76
77
|
|
@@ -111,27 +112,6 @@
|
|
111
112
|
|
112
113
|
|
113
114
|
|
114
|
-
<section class="attribute-method-details" class="method-section">
|
115
|
-
<header>
|
116
|
-
<h3>Attributes</h3>
|
117
|
-
</header>
|
118
|
-
|
119
|
-
|
120
|
-
<div id="attribute-c-configuration" class="method-detail">
|
121
|
-
<div class="method-heading attribute-method-heading">
|
122
|
-
<span class="method-name">configuration</span><span
|
123
|
-
class="attribute-access-type">[RW]</span>
|
124
|
-
</div>
|
125
|
-
|
126
|
-
<div class="method-description">
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
</div>
|
131
|
-
</div>
|
132
|
-
|
133
|
-
</section>
|
134
|
-
|
135
115
|
|
136
116
|
|
137
117
|
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
@@ -140,10 +120,10 @@
|
|
140
120
|
</header>
|
141
121
|
|
142
122
|
|
143
|
-
<div id="method-c-
|
123
|
+
<div id="method-c-configuration" class="method-detail ">
|
144
124
|
|
145
125
|
<div class="method-heading">
|
146
|
-
<span class="method-name">
|
126
|
+
<span class="method-name">configuration</span><span
|
147
127
|
class="method-args">()</span>
|
148
128
|
|
149
129
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -158,15 +138,10 @@
|
|
158
138
|
|
159
139
|
|
160
140
|
|
161
|
-
<div class="method-source-code" id="
|
162
|
-
<pre><span class="ruby-comment"># File lib/absorb_api.rb, line
|
163
|
-
<span class="ruby-keyword">def</span> <span class="ruby-
|
164
|
-
<span class="ruby-ivar">@
|
165
|
-
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">request</span> <span class="ruby-value">:json</span>
|
166
|
-
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">response</span> <span class="ruby-value">:json</span>, <span class="ruby-value">:content_type</span> =<span class="ruby-operator">></span> <span class="ruby-regexp">/\bjson$/</span>
|
167
|
-
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">adapter</span> <span class="ruby-value">:typhoeus</span>
|
168
|
-
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">headers</span> = {<span class="ruby-string">"Authorization"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">authorize</span> }
|
169
|
-
<span class="ruby-keyword">end</span>
|
141
|
+
<div class="method-source-code" id="configuration-source">
|
142
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/configuration.rb, line 10</span>
|
143
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">configuration</span>
|
144
|
+
<span class="ruby-ivar">@configuration</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">new</span>
|
170
145
|
<span class="ruby-keyword">end</span></pre>
|
171
146
|
</div>
|
172
147
|
|
@@ -178,11 +153,11 @@
|
|
178
153
|
</div>
|
179
154
|
|
180
155
|
|
181
|
-
<div id="method-c-
|
156
|
+
<div id="method-c-configure" class="method-detail ">
|
182
157
|
|
183
158
|
<div class="method-heading">
|
184
|
-
<span class="method-name">
|
185
|
-
class="method-args">()</span>
|
159
|
+
<span class="method-name">configure</span><span
|
160
|
+
class="method-args">() { |configuration| ... }</span>
|
186
161
|
|
187
162
|
<span class="method-click-advice">click to toggle source</span>
|
188
163
|
|
@@ -196,18 +171,10 @@
|
|
196
171
|
|
197
172
|
|
198
173
|
|
199
|
-
<div class="method-source-code" id="
|
200
|
-
<pre><span class="ruby-comment"># File lib/absorb_api.rb, line
|
201
|
-
<span class="ruby-keyword">def</span> <span class="ruby-
|
202
|
-
<span class="ruby-
|
203
|
-
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">request</span> <span class="ruby-value">:url_encoded</span>
|
204
|
-
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">response</span> <span class="ruby-value">:logger</span>
|
205
|
-
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">adapter</span> <span class="ruby-value">:typhoeus</span>
|
206
|
-
<span class="ruby-keyword">end</span>.<span class="ruby-identifier">post</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">req</span><span class="ruby-operator">|</span>
|
207
|
-
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">url</span> <span class="ruby-string">'Authenticate'</span>, { <span class="ruby-identifier">username</span><span class="ruby-operator">:</span> <span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">absorbuser</span>, <span class="ruby-identifier">password</span><span class="ruby-operator">:</span> <span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">absorbpass</span>, <span class="ruby-identifier">privateKey</span><span class="ruby-operator">:</span> <span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">absorbkey</span> }
|
208
|
-
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-string">'Content-Type'</span>] = <span class="ruby-string">'application/json'</span>
|
209
|
-
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-string">"accept"</span>] = <span class="ruby-string">"json"</span>
|
210
|
-
<span class="ruby-keyword">end</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">'\"'</span>)
|
174
|
+
<div class="method-source-code" id="configure-source">
|
175
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/configuration.rb, line 18</span>
|
176
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">configure</span>
|
177
|
+
<span class="ruby-keyword">yield</span>(<span class="ruby-identifier">configuration</span>)
|
211
178
|
<span class="ruby-keyword">end</span></pre>
|
212
179
|
</div>
|
213
180
|
|
@@ -219,11 +186,11 @@
|
|
219
186
|
</div>
|
220
187
|
|
221
188
|
|
222
|
-
<div id="method-c-
|
189
|
+
<div id="method-c-reset" class="method-detail ">
|
223
190
|
|
224
191
|
<div class="method-heading">
|
225
|
-
<span class="method-name">
|
226
|
-
class="method-args">()
|
192
|
+
<span class="method-name">reset</span><span
|
193
|
+
class="method-args">()</span>
|
227
194
|
|
228
195
|
<span class="method-click-advice">click to toggle source</span>
|
229
196
|
|
@@ -237,10 +204,10 @@
|
|
237
204
|
|
238
205
|
|
239
206
|
|
240
|
-
<div class="method-source-code" id="
|
241
|
-
<pre><span class="ruby-comment"># File lib/absorb_api/configuration.rb, line
|
242
|
-
<span class="ruby-keyword">def</span> <span class="ruby-
|
243
|
-
<span class="ruby-
|
207
|
+
<div class="method-source-code" id="reset-source">
|
208
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/configuration.rb, line 14</span>
|
209
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">reset</span>
|
210
|
+
<span class="ruby-ivar">@configuration</span> = <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">new</span>
|
244
211
|
<span class="ruby-keyword">end</span></pre>
|
245
212
|
</div>
|
246
213
|
|
@@ -252,10 +219,10 @@
|
|
252
219
|
</div>
|
253
220
|
|
254
221
|
|
255
|
-
<div id="method-c-
|
222
|
+
<div id="method-c-token" class="method-detail ">
|
256
223
|
|
257
224
|
<div class="method-heading">
|
258
|
-
<span class="method-name">
|
225
|
+
<span class="method-name">token</span><span
|
259
226
|
class="method-args">()</span>
|
260
227
|
|
261
228
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -270,10 +237,12 @@
|
|
270
237
|
|
271
238
|
|
272
239
|
|
273
|
-
<div class="method-source-code" id="
|
274
|
-
<pre><span class="ruby-comment"># File lib/absorb_api
|
275
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">
|
276
|
-
<span class="ruby-
|
240
|
+
<div class="method-source-code" id="token-source">
|
241
|
+
<pre><span class="ruby-comment"># File lib/absorb_api.rb, line 42</span>
|
242
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">token</span>
|
243
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">authorization</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Authorize</span>.<span class="ruby-identifier">new</span>
|
244
|
+
|
245
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">authorization</span>.<span class="ruby-identifier">token</span>
|
277
246
|
<span class="ruby-keyword">end</span></pre>
|
278
247
|
</div>
|
279
248
|
|
@@ -293,7 +262,7 @@
|
|
293
262
|
|
294
263
|
<footer id="validator-badges" role="contentinfo">
|
295
264
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
296
|
-
<p>Generated by <a href="
|
265
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
297
266
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
298
267
|
</footer>
|
299
268
|
|
@@ -0,0 +1,358 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class AbsorbApi::Api - 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
|
+
|
67
|
+
|
68
|
+
<!-- Method Quickref -->
|
69
|
+
<div id="method-list-section" class="nav-section">
|
70
|
+
<h3>Methods</h3>
|
71
|
+
|
72
|
+
<ul class="link-list" role="directory">
|
73
|
+
|
74
|
+
<li ><a href="#method-i-connection">#connection</a>
|
75
|
+
|
76
|
+
<li ><a href="#method-i-delete">#delete</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-i-get">#get</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-patch">#patch</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-post">#post</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-put">#put</a>
|
85
|
+
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
</nav>
|
91
|
+
|
92
|
+
<main role="main" aria-labelledby="class-AbsorbApi::Api">
|
93
|
+
<h1 id="class-AbsorbApi::Api" class="class">
|
94
|
+
class AbsorbApi::Api
|
95
|
+
</h1>
|
96
|
+
|
97
|
+
<section class="description">
|
98
|
+
|
99
|
+
</section>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<section class="attribute-method-details" class="method-section">
|
113
|
+
<header>
|
114
|
+
<h3>Attributes</h3>
|
115
|
+
</header>
|
116
|
+
|
117
|
+
|
118
|
+
<div id="attribute-i-connection" class="method-detail">
|
119
|
+
<div class="method-heading attribute-method-heading">
|
120
|
+
<span class="method-name">connection</span><span
|
121
|
+
class="attribute-access-type">[W]</span>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</section>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
136
|
+
<header>
|
137
|
+
<h3>Public Instance Methods</h3>
|
138
|
+
</header>
|
139
|
+
|
140
|
+
|
141
|
+
<div id="method-i-connection" class="method-detail ">
|
142
|
+
|
143
|
+
<div class="method-heading">
|
144
|
+
<span class="method-name">connection</span><span
|
145
|
+
class="method-args">()</span>
|
146
|
+
|
147
|
+
<span class="method-click-advice">click to toggle source</span>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
<div class="method-description">
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<div class="method-source-code" id="connection-source">
|
160
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/api.rb, line 8</span>
|
161
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">connection</span>
|
162
|
+
<span class="ruby-constant">Faraday</span>.<span class="ruby-identifier">new</span>(
|
163
|
+
<span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">url</span>,
|
164
|
+
<span class="ruby-identifier">parallel_manager</span><span class="ruby-operator">:</span> <span class="ruby-constant">Typhoeus</span><span class="ruby-operator">::</span><span class="ruby-constant">Hydra</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">max_concurrency</span><span class="ruby-operator">:</span> <span class="ruby-value">200</span>)
|
165
|
+
) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">faraday</span><span class="ruby-operator">|</span>
|
166
|
+
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">request</span> <span class="ruby-value">:json</span>
|
167
|
+
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">response</span> <span class="ruby-value">:json</span>, <span class="ruby-identifier">content_type</span><span class="ruby-operator">:</span> <span class="ruby-regexp">/\bjson$/</span>
|
168
|
+
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">adapter</span> <span class="ruby-value">:typhoeus</span>
|
169
|
+
<span class="ruby-identifier">faraday</span>.<span class="ruby-identifier">headers</span> = { <span class="ruby-string">"Authorization"</span> =<span class="ruby-operator">></span> <span class="ruby-constant">AbsorbApi</span>.<span class="ruby-identifier">token</span> }
|
170
|
+
<span class="ruby-keyword">end</span>
|
171
|
+
<span class="ruby-keyword">end</span></pre>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
</div>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
<div id="method-i-delete" class="method-detail ">
|
183
|
+
|
184
|
+
<div class="method-heading">
|
185
|
+
<span class="method-name">delete</span><span
|
186
|
+
class="method-args">(path, params = {})</span>
|
187
|
+
|
188
|
+
<span class="method-click-advice">click to toggle source</span>
|
189
|
+
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<div class="method-source-code" id="delete-source">
|
201
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/api.rb, line 36</span>
|
202
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span> = {})
|
203
|
+
<span class="ruby-identifier">request</span>(<span class="ruby-value">:delete</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span>)
|
204
|
+
<span class="ruby-keyword">end</span></pre>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</div>
|
213
|
+
|
214
|
+
|
215
|
+
<div id="method-i-get" class="method-detail ">
|
216
|
+
|
217
|
+
<div class="method-heading">
|
218
|
+
<span class="method-name">get</span><span
|
219
|
+
class="method-args">(path, params = {})</span>
|
220
|
+
|
221
|
+
<span class="method-click-advice">click to toggle source</span>
|
222
|
+
|
223
|
+
</div>
|
224
|
+
|
225
|
+
|
226
|
+
<div class="method-description">
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<div class="method-source-code" id="get-source">
|
234
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/api.rb, line 20</span>
|
235
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span> = {})
|
236
|
+
<span class="ruby-identifier">request</span>(<span class="ruby-value">:get</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span>)
|
237
|
+
<span class="ruby-keyword">end</span></pre>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
</div>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
<div id="method-i-patch" class="method-detail ">
|
249
|
+
|
250
|
+
<div class="method-heading">
|
251
|
+
<span class="method-name">patch</span><span
|
252
|
+
class="method-args">(path, params = {})</span>
|
253
|
+
|
254
|
+
<span class="method-click-advice">click to toggle source</span>
|
255
|
+
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
<div class="method-description">
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
<div class="method-source-code" id="patch-source">
|
267
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/api.rb, line 28</span>
|
268
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">patch</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span> = {})
|
269
|
+
<span class="ruby-identifier">request</span>(<span class="ruby-value">:patch</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span>)
|
270
|
+
<span class="ruby-keyword">end</span></pre>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
<div id="method-i-post" class="method-detail ">
|
282
|
+
|
283
|
+
<div class="method-heading">
|
284
|
+
<span class="method-name">post</span><span
|
285
|
+
class="method-args">(path, params = {})</span>
|
286
|
+
|
287
|
+
<span class="method-click-advice">click to toggle source</span>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
|
292
|
+
<div class="method-description">
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
<div class="method-source-code" id="post-source">
|
300
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/api.rb, line 32</span>
|
301
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">post</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span> = {})
|
302
|
+
<span class="ruby-identifier">request</span>(<span class="ruby-value">:post</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span>)
|
303
|
+
<span class="ruby-keyword">end</span></pre>
|
304
|
+
</div>
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
<div id="method-i-put" class="method-detail ">
|
315
|
+
|
316
|
+
<div class="method-heading">
|
317
|
+
<span class="method-name">put</span><span
|
318
|
+
class="method-args">(path, params = {})</span>
|
319
|
+
|
320
|
+
<span class="method-click-advice">click to toggle source</span>
|
321
|
+
|
322
|
+
</div>
|
323
|
+
|
324
|
+
|
325
|
+
<div class="method-description">
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
<div class="method-source-code" id="put-source">
|
333
|
+
<pre><span class="ruby-comment"># File lib/absorb_api/api.rb, line 24</span>
|
334
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">put</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span> = {})
|
335
|
+
<span class="ruby-identifier">request</span>(<span class="ruby-value">:put</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">params</span>)
|
336
|
+
<span class="ruby-keyword">end</span></pre>
|
337
|
+
</div>
|
338
|
+
|
339
|
+
</div>
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
</div>
|
345
|
+
|
346
|
+
|
347
|
+
</section>
|
348
|
+
|
349
|
+
</section>
|
350
|
+
</main>
|
351
|
+
|
352
|
+
|
353
|
+
<footer id="validator-badges" role="contentinfo">
|
354
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
355
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
356
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
357
|
+
</footer>
|
358
|
+
|