clever-ruby 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/clever-ruby.gemspec +9 -7
- data/lib/clever-ruby.rb +2 -0
- data/lib/clever-ruby/api_operations/page.rb +19 -0
- data/lib/clever-ruby/api_operations/pagelist.rb +23 -0
- data/lib/clever-ruby/district.rb +13 -19
- data/lib/clever-ruby/student.rb +1 -1
- data/lib/clever-ruby/version.rb +1 -1
- data/test/data/vcr_cassettes/districts_event_pages.yml +291 -0
- data/test/data/vcr_cassettes/districts_school_pages.yml +362 -0
- data/test/data/vcr_cassettes/districts_schools.yml +159 -45
- data/test/data/vcr_cassettes/districts_section_pages.yml +665 -0
- data/test/data/vcr_cassettes/districts_sections.yml +247 -45
- data/test/data/vcr_cassettes/districts_student_pages.yml +15455 -0
- data/test/data/vcr_cassettes/districts_students.yml +2983 -1270
- data/test/data/vcr_cassettes/districts_teacher_pages.yml +563 -0
- data/test/data/vcr_cassettes/districts_teachers.yml +243 -93
- data/test/integration/district_test.rb +52 -21
- data/test/test_helper.rb +1 -0
- metadata +48 -4
data/.gitignore
CHANGED
data/clever-ruby.gemspec
CHANGED
@@ -17,12 +17,14 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_runtime_dependency 'multi_json',
|
21
|
-
gem.add_runtime_dependency 'rest-client',
|
20
|
+
gem.add_runtime_dependency 'multi_json', '~> 1.7.0'
|
21
|
+
gem.add_runtime_dependency 'rest-client', '~> 1.6.7'
|
22
22
|
gem.add_development_dependency 'rake'
|
23
|
-
gem.add_development_dependency 'minitest',
|
24
|
-
gem.add_development_dependency 'shoulda',
|
25
|
-
gem.add_development_dependency 'rdoc',
|
26
|
-
gem.add_development_dependency 'vcr',
|
27
|
-
gem.add_development_dependency 'webmock',
|
23
|
+
gem.add_development_dependency 'minitest', '~> 4.4.0'
|
24
|
+
gem.add_development_dependency 'shoulda', '~> 3.3.2'
|
25
|
+
gem.add_development_dependency 'rdoc', '~> 3.12'
|
26
|
+
gem.add_development_dependency 'vcr', '~> 2.4.0'
|
27
|
+
gem.add_development_dependency 'webmock', '~> 1.9.0'
|
28
|
+
gem.add_development_dependency 'pry', '~> 0.9.9.6'
|
29
|
+
gem.add_development_dependency 'activesupport', '~> 3.2.11'
|
28
30
|
end
|
data/lib/clever-ruby.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Clever
|
2
|
+
module APIOperations
|
3
|
+
class Page
|
4
|
+
attr_accessor :paging
|
5
|
+
def initialize(uri, filters={})
|
6
|
+
@uri = uri
|
7
|
+
@filters = filters
|
8
|
+
|
9
|
+
response = Clever.request(:get, uri, filters)
|
10
|
+
@list = Util.convert_to_clever_object(response[:data])
|
11
|
+
self.paging = response[:paging]
|
12
|
+
end
|
13
|
+
|
14
|
+
def all
|
15
|
+
@list
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Clever
|
2
|
+
module APIOperations
|
3
|
+
class PageList
|
4
|
+
def initialize(uri, filters={})
|
5
|
+
@uri = uri
|
6
|
+
@filters = filters
|
7
|
+
end
|
8
|
+
|
9
|
+
def each
|
10
|
+
current = 0
|
11
|
+
total = 1
|
12
|
+
while current < total
|
13
|
+
page = Page.new(@uri, @filters.merge({ page: current + 1 }))
|
14
|
+
|
15
|
+
yield page
|
16
|
+
|
17
|
+
current = page.paging[:current]
|
18
|
+
total = page.paging[:total]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/clever-ruby/district.rb
CHANGED
@@ -7,33 +7,27 @@ module Clever
|
|
7
7
|
[]
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
[:schools, :teachers, :sections, :students, :events].each do |name|
|
11
|
+
define_method(name) do |filters = {}|
|
12
|
+
get_linked_resources name.to_s, filters
|
13
|
+
end
|
12
14
|
end
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
def sections(filters={})
|
19
|
-
get_linked_resources 'sections', filters
|
20
|
-
end
|
21
|
-
|
22
|
-
def students(filters={})
|
23
|
-
get_linked_resources 'students', filters
|
24
|
-
end
|
25
|
-
|
26
|
-
def events(filters={})
|
27
|
-
get_linked_resources 'events', filters
|
16
|
+
[:school_pages, :teacher_pages, :section_pages, :student_pages, :event_pages].each do |name|
|
17
|
+
define_method(name) do |filters = {}|
|
18
|
+
Clever::APIOperations::PageList.new(get_uri(name.to_s.gsub('_page', '')), filters)
|
19
|
+
end
|
28
20
|
end
|
29
21
|
|
30
22
|
private
|
31
23
|
|
32
24
|
def get_linked_resources(resource_type, filters={})
|
25
|
+
Util.convert_to_clever_object(Clever.request(:get, get_uri(resource_type), filters)[:data])
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_uri(resource_type)
|
33
29
|
refresh
|
34
|
-
|
35
|
-
response = Clever.request(:get, uri, filters)
|
36
|
-
Util.convert_to_clever_object(response[:data])
|
30
|
+
links.detect {|link| link[:rel] == resource_type }[:uri]
|
37
31
|
end
|
38
32
|
end
|
39
33
|
end
|
data/lib/clever-ruby/student.rb
CHANGED
@@ -3,7 +3,7 @@ module Clever
|
|
3
3
|
include Clever::APIOperations::List
|
4
4
|
|
5
5
|
def optional_attributes
|
6
|
-
[:student_number, :state_id, :location, :gender, :dob, :grade, :frl_status, :race, :hispanic_ethnicity, :email]
|
6
|
+
[:student_number, :state_id, :location, :gender, :dob, :grade, :frl_status, :race, :hispanic_ethnicity, :email, :credentials]
|
7
7
|
end
|
8
8
|
|
9
9
|
def photo
|
data/lib/clever-ruby/version.rb
CHANGED
@@ -0,0 +1,291 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts?
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Access-Control-Allow-Headers:
|
22
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
23
|
+
Access-Control-Allow-Methods:
|
24
|
+
- GET,PUT,POST,DELETE
|
25
|
+
Access-Control-Allow-Origin:
|
26
|
+
- ! '*'
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Date:
|
30
|
+
- Wed, 11 Sep 2013 19:15:28 GMT
|
31
|
+
Server:
|
32
|
+
- nginx/1.4.1
|
33
|
+
X-Powered-By:
|
34
|
+
- Express
|
35
|
+
Content-Length:
|
36
|
+
- '217'
|
37
|
+
Connection:
|
38
|
+
- keep-alive
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"paging":{"current":1,"total":1,"count":1},"data":[{"data":{"name":"Demo
|
42
|
+
District","id":"4fd43cc56d11340000000005"},"uri":"/v1.1/districts/4fd43cc56d11340000000005"}],"links":[{"rel":"self","uri":"/v1.1/districts"}]}'
|
43
|
+
http_version:
|
44
|
+
recorded_at: Wed, 11 Sep 2013 19:15:28 GMT
|
45
|
+
- request:
|
46
|
+
method: get
|
47
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
48
|
+
body:
|
49
|
+
encoding: US-ASCII
|
50
|
+
string: ''
|
51
|
+
headers:
|
52
|
+
Accept:
|
53
|
+
- ! '*/*; q=0.5, application/xml'
|
54
|
+
Accept-Encoding:
|
55
|
+
- gzip, deflate
|
56
|
+
User-Agent:
|
57
|
+
- Ruby
|
58
|
+
response:
|
59
|
+
status:
|
60
|
+
code: 200
|
61
|
+
message: OK
|
62
|
+
headers:
|
63
|
+
Access-Control-Allow-Headers:
|
64
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
65
|
+
Access-Control-Allow-Methods:
|
66
|
+
- GET,PUT,POST,DELETE
|
67
|
+
Access-Control-Allow-Origin:
|
68
|
+
- ! '*'
|
69
|
+
Content-Type:
|
70
|
+
- application/json; charset=utf-8
|
71
|
+
Date:
|
72
|
+
- Wed, 11 Sep 2013 19:15:29 GMT
|
73
|
+
Server:
|
74
|
+
- nginx/1.4.1
|
75
|
+
X-Powered-By:
|
76
|
+
- Express
|
77
|
+
Content-Length:
|
78
|
+
- '599'
|
79
|
+
Connection:
|
80
|
+
- keep-alive
|
81
|
+
body:
|
82
|
+
encoding: US-ASCII
|
83
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
84
|
+
http_version:
|
85
|
+
recorded_at: Wed, 11 Sep 2013 19:15:29 GMT
|
86
|
+
- request:
|
87
|
+
method: get
|
88
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
89
|
+
body:
|
90
|
+
encoding: US-ASCII
|
91
|
+
string: ''
|
92
|
+
headers:
|
93
|
+
Accept:
|
94
|
+
- ! '*/*; q=0.5, application/xml'
|
95
|
+
Accept-Encoding:
|
96
|
+
- gzip, deflate
|
97
|
+
User-Agent:
|
98
|
+
- Ruby
|
99
|
+
response:
|
100
|
+
status:
|
101
|
+
code: 200
|
102
|
+
message: OK
|
103
|
+
headers:
|
104
|
+
Access-Control-Allow-Headers:
|
105
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
106
|
+
Access-Control-Allow-Methods:
|
107
|
+
- GET,PUT,POST,DELETE
|
108
|
+
Access-Control-Allow-Origin:
|
109
|
+
- ! '*'
|
110
|
+
Content-Type:
|
111
|
+
- application/json; charset=utf-8
|
112
|
+
Date:
|
113
|
+
- Wed, 11 Sep 2013 19:15:29 GMT
|
114
|
+
Server:
|
115
|
+
- nginx/1.4.1
|
116
|
+
X-Powered-By:
|
117
|
+
- Express
|
118
|
+
Content-Length:
|
119
|
+
- '599'
|
120
|
+
Connection:
|
121
|
+
- keep-alive
|
122
|
+
body:
|
123
|
+
encoding: US-ASCII
|
124
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
125
|
+
http_version:
|
126
|
+
recorded_at: Wed, 11 Sep 2013 19:15:29 GMT
|
127
|
+
- request:
|
128
|
+
method: get
|
129
|
+
uri: https://DEMO_KEY:@api.getclever.com//v1.1/districts/4fd43cc56d11340000000005/events?limit=100000
|
130
|
+
body:
|
131
|
+
encoding: US-ASCII
|
132
|
+
string: ''
|
133
|
+
headers:
|
134
|
+
Accept:
|
135
|
+
- ! '*/*; q=0.5, application/xml'
|
136
|
+
Accept-Encoding:
|
137
|
+
- gzip, deflate
|
138
|
+
User-Agent:
|
139
|
+
- Ruby
|
140
|
+
response:
|
141
|
+
status:
|
142
|
+
code: 200
|
143
|
+
message: OK
|
144
|
+
headers:
|
145
|
+
Access-Control-Allow-Headers:
|
146
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
147
|
+
Access-Control-Allow-Methods:
|
148
|
+
- GET,PUT,POST,DELETE
|
149
|
+
Access-Control-Allow-Origin:
|
150
|
+
- ! '*'
|
151
|
+
Content-Type:
|
152
|
+
- application/json; charset=utf-8
|
153
|
+
Date:
|
154
|
+
- Wed, 11 Sep 2013 19:15:30 GMT
|
155
|
+
Server:
|
156
|
+
- nginx/1.4.1
|
157
|
+
X-Powered-By:
|
158
|
+
- Express
|
159
|
+
Content-Length:
|
160
|
+
- '148'
|
161
|
+
Connection:
|
162
|
+
- keep-alive
|
163
|
+
body:
|
164
|
+
encoding: US-ASCII
|
165
|
+
string: ! '{"paging":{"current":0,"total":0,"count":0},"data":[],"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005/events?limit=100000"}]}'
|
166
|
+
http_version:
|
167
|
+
recorded_at: Wed, 11 Sep 2013 19:15:30 GMT
|
168
|
+
- request:
|
169
|
+
method: get
|
170
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
171
|
+
body:
|
172
|
+
encoding: US-ASCII
|
173
|
+
string: ''
|
174
|
+
headers:
|
175
|
+
Accept:
|
176
|
+
- ! '*/*; q=0.5, application/xml'
|
177
|
+
Accept-Encoding:
|
178
|
+
- gzip, deflate
|
179
|
+
User-Agent:
|
180
|
+
- Ruby
|
181
|
+
response:
|
182
|
+
status:
|
183
|
+
code: 200
|
184
|
+
message: OK
|
185
|
+
headers:
|
186
|
+
Access-Control-Allow-Headers:
|
187
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
188
|
+
Access-Control-Allow-Methods:
|
189
|
+
- GET,PUT,POST,DELETE
|
190
|
+
Access-Control-Allow-Origin:
|
191
|
+
- ! '*'
|
192
|
+
Content-Type:
|
193
|
+
- application/json; charset=utf-8
|
194
|
+
Date:
|
195
|
+
- Wed, 11 Sep 2013 19:15:30 GMT
|
196
|
+
Server:
|
197
|
+
- nginx/1.4.1
|
198
|
+
X-Powered-By:
|
199
|
+
- Express
|
200
|
+
Content-Length:
|
201
|
+
- '599'
|
202
|
+
Connection:
|
203
|
+
- keep-alive
|
204
|
+
body:
|
205
|
+
encoding: US-ASCII
|
206
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
207
|
+
http_version:
|
208
|
+
recorded_at: Wed, 11 Sep 2013 19:15:30 GMT
|
209
|
+
- request:
|
210
|
+
method: get
|
211
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
212
|
+
body:
|
213
|
+
encoding: US-ASCII
|
214
|
+
string: ''
|
215
|
+
headers:
|
216
|
+
Accept:
|
217
|
+
- ! '*/*; q=0.5, application/xml'
|
218
|
+
Accept-Encoding:
|
219
|
+
- gzip, deflate
|
220
|
+
User-Agent:
|
221
|
+
- Ruby
|
222
|
+
response:
|
223
|
+
status:
|
224
|
+
code: 200
|
225
|
+
message: OK
|
226
|
+
headers:
|
227
|
+
Access-Control-Allow-Headers:
|
228
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
229
|
+
Access-Control-Allow-Methods:
|
230
|
+
- GET,PUT,POST,DELETE
|
231
|
+
Access-Control-Allow-Origin:
|
232
|
+
- ! '*'
|
233
|
+
Content-Type:
|
234
|
+
- application/json; charset=utf-8
|
235
|
+
Date:
|
236
|
+
- Wed, 11 Sep 2013 19:15:31 GMT
|
237
|
+
Server:
|
238
|
+
- nginx/1.4.1
|
239
|
+
X-Powered-By:
|
240
|
+
- Express
|
241
|
+
Content-Length:
|
242
|
+
- '599'
|
243
|
+
Connection:
|
244
|
+
- keep-alive
|
245
|
+
body:
|
246
|
+
encoding: US-ASCII
|
247
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
248
|
+
http_version:
|
249
|
+
recorded_at: Wed, 11 Sep 2013 19:15:31 GMT
|
250
|
+
- request:
|
251
|
+
method: get
|
252
|
+
uri: https://DEMO_KEY:@api.getclever.com//v1.1/districts/4fd43cc56d11340000000005/events?limit=1&page=1
|
253
|
+
body:
|
254
|
+
encoding: US-ASCII
|
255
|
+
string: ''
|
256
|
+
headers:
|
257
|
+
Accept:
|
258
|
+
- ! '*/*; q=0.5, application/xml'
|
259
|
+
Accept-Encoding:
|
260
|
+
- gzip, deflate
|
261
|
+
User-Agent:
|
262
|
+
- Ruby
|
263
|
+
response:
|
264
|
+
status:
|
265
|
+
code: 200
|
266
|
+
message: OK
|
267
|
+
headers:
|
268
|
+
Access-Control-Allow-Headers:
|
269
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
270
|
+
Access-Control-Allow-Methods:
|
271
|
+
- GET,PUT,POST,DELETE
|
272
|
+
Access-Control-Allow-Origin:
|
273
|
+
- ! '*'
|
274
|
+
Content-Type:
|
275
|
+
- application/json; charset=utf-8
|
276
|
+
Date:
|
277
|
+
- Wed, 11 Sep 2013 19:15:31 GMT
|
278
|
+
Server:
|
279
|
+
- nginx/1.4.1
|
280
|
+
X-Powered-By:
|
281
|
+
- Express
|
282
|
+
Content-Length:
|
283
|
+
- '150'
|
284
|
+
Connection:
|
285
|
+
- keep-alive
|
286
|
+
body:
|
287
|
+
encoding: US-ASCII
|
288
|
+
string: ! '{"paging":{"current":0,"total":0,"count":0},"data":[],"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005/events?limit=1&page=1"}]}'
|
289
|
+
http_version:
|
290
|
+
recorded_at: Wed, 11 Sep 2013 19:15:31 GMT
|
291
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,362 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts?
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Access-Control-Allow-Headers:
|
22
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
23
|
+
Access-Control-Allow-Methods:
|
24
|
+
- GET,PUT,POST,DELETE
|
25
|
+
Access-Control-Allow-Origin:
|
26
|
+
- ! '*'
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Date:
|
30
|
+
- Wed, 11 Sep 2013 19:06:26 GMT
|
31
|
+
Server:
|
32
|
+
- nginx/1.4.1
|
33
|
+
X-Powered-By:
|
34
|
+
- Express
|
35
|
+
Content-Length:
|
36
|
+
- '217'
|
37
|
+
Connection:
|
38
|
+
- keep-alive
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"paging":{"current":1,"total":1,"count":1},"data":[{"data":{"name":"Demo
|
42
|
+
District","id":"4fd43cc56d11340000000005"},"uri":"/v1.1/districts/4fd43cc56d11340000000005"}],"links":[{"rel":"self","uri":"/v1.1/districts"}]}'
|
43
|
+
http_version:
|
44
|
+
recorded_at: Wed, 11 Sep 2013 19:06:26 GMT
|
45
|
+
- request:
|
46
|
+
method: get
|
47
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
48
|
+
body:
|
49
|
+
encoding: US-ASCII
|
50
|
+
string: ''
|
51
|
+
headers:
|
52
|
+
Accept:
|
53
|
+
- ! '*/*; q=0.5, application/xml'
|
54
|
+
Accept-Encoding:
|
55
|
+
- gzip, deflate
|
56
|
+
User-Agent:
|
57
|
+
- Ruby
|
58
|
+
response:
|
59
|
+
status:
|
60
|
+
code: 200
|
61
|
+
message: OK
|
62
|
+
headers:
|
63
|
+
Access-Control-Allow-Headers:
|
64
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
65
|
+
Access-Control-Allow-Methods:
|
66
|
+
- GET,PUT,POST,DELETE
|
67
|
+
Access-Control-Allow-Origin:
|
68
|
+
- ! '*'
|
69
|
+
Content-Type:
|
70
|
+
- application/json; charset=utf-8
|
71
|
+
Date:
|
72
|
+
- Wed, 11 Sep 2013 19:06:27 GMT
|
73
|
+
Server:
|
74
|
+
- nginx/1.4.1
|
75
|
+
X-Powered-By:
|
76
|
+
- Express
|
77
|
+
Content-Length:
|
78
|
+
- '599'
|
79
|
+
Connection:
|
80
|
+
- keep-alive
|
81
|
+
body:
|
82
|
+
encoding: US-ASCII
|
83
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
84
|
+
http_version:
|
85
|
+
recorded_at: Wed, 11 Sep 2013 19:06:27 GMT
|
86
|
+
- request:
|
87
|
+
method: get
|
88
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
89
|
+
body:
|
90
|
+
encoding: US-ASCII
|
91
|
+
string: ''
|
92
|
+
headers:
|
93
|
+
Accept:
|
94
|
+
- ! '*/*; q=0.5, application/xml'
|
95
|
+
Accept-Encoding:
|
96
|
+
- gzip, deflate
|
97
|
+
User-Agent:
|
98
|
+
- Ruby
|
99
|
+
response:
|
100
|
+
status:
|
101
|
+
code: 200
|
102
|
+
message: OK
|
103
|
+
headers:
|
104
|
+
Access-Control-Allow-Headers:
|
105
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
106
|
+
Access-Control-Allow-Methods:
|
107
|
+
- GET,PUT,POST,DELETE
|
108
|
+
Access-Control-Allow-Origin:
|
109
|
+
- ! '*'
|
110
|
+
Content-Type:
|
111
|
+
- application/json; charset=utf-8
|
112
|
+
Date:
|
113
|
+
- Wed, 11 Sep 2013 19:06:28 GMT
|
114
|
+
Server:
|
115
|
+
- nginx/1.4.1
|
116
|
+
X-Powered-By:
|
117
|
+
- Express
|
118
|
+
Content-Length:
|
119
|
+
- '599'
|
120
|
+
Connection:
|
121
|
+
- keep-alive
|
122
|
+
body:
|
123
|
+
encoding: US-ASCII
|
124
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
125
|
+
http_version:
|
126
|
+
recorded_at: Wed, 11 Sep 2013 19:06:28 GMT
|
127
|
+
- request:
|
128
|
+
method: get
|
129
|
+
uri: https://DEMO_KEY:@api.getclever.com//v1.1/districts/4fd43cc56d11340000000005/schools?limit=100000
|
130
|
+
body:
|
131
|
+
encoding: US-ASCII
|
132
|
+
string: ''
|
133
|
+
headers:
|
134
|
+
Accept:
|
135
|
+
- ! '*/*; q=0.5, application/xml'
|
136
|
+
Accept-Encoding:
|
137
|
+
- gzip, deflate
|
138
|
+
User-Agent:
|
139
|
+
- Ruby
|
140
|
+
response:
|
141
|
+
status:
|
142
|
+
code: 200
|
143
|
+
message: OK
|
144
|
+
headers:
|
145
|
+
Access-Control-Allow-Headers:
|
146
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
147
|
+
Access-Control-Allow-Methods:
|
148
|
+
- GET,PUT,POST,DELETE
|
149
|
+
Access-Control-Allow-Origin:
|
150
|
+
- ! '*'
|
151
|
+
Content-Type:
|
152
|
+
- application/json; charset=utf-8
|
153
|
+
Date:
|
154
|
+
- Wed, 11 Sep 2013 19:06:28 GMT
|
155
|
+
Etag:
|
156
|
+
- ! '"113521481"'
|
157
|
+
Server:
|
158
|
+
- nginx/1.4.1
|
159
|
+
X-Powered-By:
|
160
|
+
- Express
|
161
|
+
Content-Length:
|
162
|
+
- '2327'
|
163
|
+
Connection:
|
164
|
+
- keep-alive
|
165
|
+
body:
|
166
|
+
encoding: US-ASCII
|
167
|
+
string: ! '{"paging":{"current":1,"total":1,"count":4},"data":[{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
168
|
+
Academy","nces_id":"17065379","phone":"1-(755) 019-5442","school_number":"9255","sis_id":"9255","state_id":"4","location":{"address":"18828
|
169
|
+
Kutch Court","city":"Dessiemouth","state":"IA","zip":"37471-9969"},"principal":{"email":"eda_barrows@mailinator.com","name":"Colleen
|
170
|
+
Gottlieb"},"last_modified":"2012-11-07T00:44:53.065Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000001"},"uri":"/v1.1/schools/4fee004cca2e43cf27000001"},{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
171
|
+
Preparatory","nces_id":"94755881","phone":"(527) 825-2248","school_number":"2559","sis_id":"2559","state_id":"23","location":{"address":"42139
|
172
|
+
Fadel Mountains","city":"Thomasfort","state":"AP","zip":"61397-3760"},"principal":{"email":"nikolas@mailinator.com","name":"Rudolph
|
173
|
+
Howe"},"last_modified":"2012-11-07T00:44:53.079Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000002"},"uri":"/v1.1/schools/4fee004cca2e43cf27000002"},{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
174
|
+
High School","nces_id":"44270647","phone":"1-(895) 295-3507","school_number":"4083","sis_id":"4083","state_id":"12","location":{"address":"9538
|
175
|
+
Leffler Forks","city":"Gwendolynville","state":"NH","zip":"58530-7427"},"principal":{"email":"domingo_williamson@mailinator.com","name":"Krystal
|
176
|
+
Kiehn"},"last_modified":"2012-11-07T00:44:53.093Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000003"},"uri":"/v1.1/schools/4fee004cca2e43cf27000003"},{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
177
|
+
Memorial High","nces_id":"26309489","phone":"1-(124) 215-8079","school_number":"3935","sis_id":"3935","state_id":"23","location":{"address":"10960
|
178
|
+
Kilback View","city":"North Sarina","state":"MP","zip":"58717-8256"},"principal":{"email":"otto_sanford@mailinator.com","name":"Maryse
|
179
|
+
Tillman"},"last_modified":"2012-11-07T00:44:53.104Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000004"},"uri":"/v1.1/schools/4fee004cca2e43cf27000004"}],"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools?limit=100000"}]}'
|
180
|
+
http_version:
|
181
|
+
recorded_at: Wed, 11 Sep 2013 19:06:28 GMT
|
182
|
+
- request:
|
183
|
+
method: get
|
184
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
185
|
+
body:
|
186
|
+
encoding: US-ASCII
|
187
|
+
string: ''
|
188
|
+
headers:
|
189
|
+
Accept:
|
190
|
+
- ! '*/*; q=0.5, application/xml'
|
191
|
+
Accept-Encoding:
|
192
|
+
- gzip, deflate
|
193
|
+
User-Agent:
|
194
|
+
- Ruby
|
195
|
+
response:
|
196
|
+
status:
|
197
|
+
code: 200
|
198
|
+
message: OK
|
199
|
+
headers:
|
200
|
+
Access-Control-Allow-Headers:
|
201
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
202
|
+
Access-Control-Allow-Methods:
|
203
|
+
- GET,PUT,POST,DELETE
|
204
|
+
Access-Control-Allow-Origin:
|
205
|
+
- ! '*'
|
206
|
+
Content-Type:
|
207
|
+
- application/json; charset=utf-8
|
208
|
+
Date:
|
209
|
+
- Wed, 11 Sep 2013 19:06:29 GMT
|
210
|
+
Server:
|
211
|
+
- nginx/1.4.1
|
212
|
+
X-Powered-By:
|
213
|
+
- Express
|
214
|
+
Content-Length:
|
215
|
+
- '599'
|
216
|
+
Connection:
|
217
|
+
- keep-alive
|
218
|
+
body:
|
219
|
+
encoding: US-ASCII
|
220
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
221
|
+
http_version:
|
222
|
+
recorded_at: Wed, 11 Sep 2013 19:06:29 GMT
|
223
|
+
- request:
|
224
|
+
method: get
|
225
|
+
uri: https://DEMO_KEY:@api.getclever.com/v1.1/districts/4fd43cc56d11340000000005
|
226
|
+
body:
|
227
|
+
encoding: US-ASCII
|
228
|
+
string: ''
|
229
|
+
headers:
|
230
|
+
Accept:
|
231
|
+
- ! '*/*; q=0.5, application/xml'
|
232
|
+
Accept-Encoding:
|
233
|
+
- gzip, deflate
|
234
|
+
User-Agent:
|
235
|
+
- Ruby
|
236
|
+
response:
|
237
|
+
status:
|
238
|
+
code: 200
|
239
|
+
message: OK
|
240
|
+
headers:
|
241
|
+
Access-Control-Allow-Headers:
|
242
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
243
|
+
Access-Control-Allow-Methods:
|
244
|
+
- GET,PUT,POST,DELETE
|
245
|
+
Access-Control-Allow-Origin:
|
246
|
+
- ! '*'
|
247
|
+
Content-Type:
|
248
|
+
- application/json; charset=utf-8
|
249
|
+
Date:
|
250
|
+
- Wed, 11 Sep 2013 19:06:29 GMT
|
251
|
+
Server:
|
252
|
+
- nginx/1.4.1
|
253
|
+
X-Powered-By:
|
254
|
+
- Express
|
255
|
+
Content-Length:
|
256
|
+
- '599'
|
257
|
+
Connection:
|
258
|
+
- keep-alive
|
259
|
+
body:
|
260
|
+
encoding: US-ASCII
|
261
|
+
string: ! '{"data":{"name":"Demo District","id":"4fd43cc56d11340000000005"},"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005"},{"rel":"schools","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools"},{"rel":"teachers","uri":"/v1.1/districts/4fd43cc56d11340000000005/teachers"},{"rel":"students","uri":"/v1.1/districts/4fd43cc56d11340000000005/students"},{"rel":"sections","uri":"/v1.1/districts/4fd43cc56d11340000000005/sections"},{"rel":"properties","uri":"/v1.1/districts/4fd43cc56d11340000000005/properties"},{"rel":"events","uri":"/v1.1/districts/4fd43cc56d11340000000005/events"}]}'
|
262
|
+
http_version:
|
263
|
+
recorded_at: Wed, 11 Sep 2013 19:06:29 GMT
|
264
|
+
- request:
|
265
|
+
method: get
|
266
|
+
uri: https://DEMO_KEY:@api.getclever.com//v1.1/districts/4fd43cc56d11340000000005/schools?limit=2&page=1
|
267
|
+
body:
|
268
|
+
encoding: US-ASCII
|
269
|
+
string: ''
|
270
|
+
headers:
|
271
|
+
Accept:
|
272
|
+
- ! '*/*; q=0.5, application/xml'
|
273
|
+
Accept-Encoding:
|
274
|
+
- gzip, deflate
|
275
|
+
User-Agent:
|
276
|
+
- Ruby
|
277
|
+
response:
|
278
|
+
status:
|
279
|
+
code: 200
|
280
|
+
message: OK
|
281
|
+
headers:
|
282
|
+
Access-Control-Allow-Headers:
|
283
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
284
|
+
Access-Control-Allow-Methods:
|
285
|
+
- GET,PUT,POST,DELETE
|
286
|
+
Access-Control-Allow-Origin:
|
287
|
+
- ! '*'
|
288
|
+
Content-Type:
|
289
|
+
- application/json; charset=utf-8
|
290
|
+
Date:
|
291
|
+
- Wed, 11 Sep 2013 19:06:30 GMT
|
292
|
+
Etag:
|
293
|
+
- ! '"210138414"'
|
294
|
+
Server:
|
295
|
+
- nginx/1.4.1
|
296
|
+
X-Powered-By:
|
297
|
+
- Express
|
298
|
+
Content-Length:
|
299
|
+
- '1315'
|
300
|
+
Connection:
|
301
|
+
- keep-alive
|
302
|
+
body:
|
303
|
+
encoding: US-ASCII
|
304
|
+
string: ! '{"paging":{"current":1,"total":2,"count":4},"data":[{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
305
|
+
Academy","nces_id":"17065379","phone":"1-(755) 019-5442","school_number":"9255","sis_id":"9255","state_id":"4","location":{"address":"18828
|
306
|
+
Kutch Court","city":"Dessiemouth","state":"IA","zip":"37471-9969"},"principal":{"email":"eda_barrows@mailinator.com","name":"Colleen
|
307
|
+
Gottlieb"},"last_modified":"2012-11-07T00:44:53.065Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000001"},"uri":"/v1.1/schools/4fee004cca2e43cf27000001"},{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
308
|
+
Preparatory","nces_id":"94755881","phone":"(527) 825-2248","school_number":"2559","sis_id":"2559","state_id":"23","location":{"address":"42139
|
309
|
+
Fadel Mountains","city":"Thomasfort","state":"AP","zip":"61397-3760"},"principal":{"email":"nikolas@mailinator.com","name":"Rudolph
|
310
|
+
Howe"},"last_modified":"2012-11-07T00:44:53.079Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000002"},"uri":"/v1.1/schools/4fee004cca2e43cf27000002"}],"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools?limit=2&page=1"},{"rel":"next","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools?limit=2&page=2"}]}'
|
311
|
+
http_version:
|
312
|
+
recorded_at: Wed, 11 Sep 2013 19:06:30 GMT
|
313
|
+
- request:
|
314
|
+
method: get
|
315
|
+
uri: https://DEMO_KEY:@api.getclever.com//v1.1/districts/4fd43cc56d11340000000005/schools?limit=2&page=2
|
316
|
+
body:
|
317
|
+
encoding: US-ASCII
|
318
|
+
string: ''
|
319
|
+
headers:
|
320
|
+
Accept:
|
321
|
+
- ! '*/*; q=0.5, application/xml'
|
322
|
+
Accept-Encoding:
|
323
|
+
- gzip, deflate
|
324
|
+
User-Agent:
|
325
|
+
- Ruby
|
326
|
+
response:
|
327
|
+
status:
|
328
|
+
code: 200
|
329
|
+
message: OK
|
330
|
+
headers:
|
331
|
+
Access-Control-Allow-Headers:
|
332
|
+
- Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
|
333
|
+
Access-Control-Allow-Methods:
|
334
|
+
- GET,PUT,POST,DELETE
|
335
|
+
Access-Control-Allow-Origin:
|
336
|
+
- ! '*'
|
337
|
+
Content-Type:
|
338
|
+
- application/json; charset=utf-8
|
339
|
+
Date:
|
340
|
+
- Wed, 11 Sep 2013 19:06:32 GMT
|
341
|
+
Etag:
|
342
|
+
- ! '"-1636206654"'
|
343
|
+
Server:
|
344
|
+
- nginx/1.4.1
|
345
|
+
X-Powered-By:
|
346
|
+
- Express
|
347
|
+
Content-Length:
|
348
|
+
- '1338'
|
349
|
+
Connection:
|
350
|
+
- keep-alive
|
351
|
+
body:
|
352
|
+
encoding: US-ASCII
|
353
|
+
string: ! '{"paging":{"current":2,"total":2,"count":4},"data":[{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
354
|
+
High School","nces_id":"44270647","phone":"1-(895) 295-3507","school_number":"4083","sis_id":"4083","state_id":"12","location":{"address":"9538
|
355
|
+
Leffler Forks","city":"Gwendolynville","state":"NH","zip":"58530-7427"},"principal":{"email":"domingo_williamson@mailinator.com","name":"Krystal
|
356
|
+
Kiehn"},"last_modified":"2012-11-07T00:44:53.093Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000003"},"uri":"/v1.1/schools/4fee004cca2e43cf27000003"},{"data":{"district":"4fd43cc56d11340000000005","high_grade":"8","low_grade":"6","name":"Clever
|
357
|
+
Memorial High","nces_id":"26309489","phone":"1-(124) 215-8079","school_number":"3935","sis_id":"3935","state_id":"23","location":{"address":"10960
|
358
|
+
Kilback View","city":"North Sarina","state":"MP","zip":"58717-8256"},"principal":{"email":"otto_sanford@mailinator.com","name":"Maryse
|
359
|
+
Tillman"},"last_modified":"2012-11-07T00:44:53.104Z","created":"2012-11-06T00:00:00.000Z","id":"4fee004cca2e43cf27000004"},"uri":"/v1.1/schools/4fee004cca2e43cf27000004"}],"links":[{"rel":"self","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools?limit=2&page=2"},{"rel":"prev","uri":"/v1.1/districts/4fd43cc56d11340000000005/schools?limit=2&page=1"}]}'
|
360
|
+
http_version:
|
361
|
+
recorded_at: Wed, 11 Sep 2013 19:06:32 GMT
|
362
|
+
recorded_with: VCR 2.4.0
|