nationbuilder-rb 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74725e766258bbda70bc52329f7b9cadb7283cdb
4
- data.tar.gz: 87eceb294433899c5c3c47408401c18f4a0737f5
3
+ metadata.gz: 75502cce5322b23668e6ece025184f010aaaf8d8
4
+ data.tar.gz: 226c8b916c20d808b7499056dbd628bf378b05b7
5
5
  SHA512:
6
- metadata.gz: 50e4516b6eb50f2d044ce80a4779a20b07f788f00eb762712d471725fcfa13e781a55e71441d8aeeea3c613c0e356a1e43c7d3fb203b75b3dcfe34388067764d
7
- data.tar.gz: 4d4647dadcc464a77dc807ac4c7321224dd76a692ffe7d7bcdca4dc30dc9ef323cd2a0a77ac936e668ecf2d41ba10d0d37d21896db25c17363730e5fd5bef1e6
6
+ metadata.gz: af24d213363b8dd87665e2be320730bc45262127cfb3ab961364382f90a47f74a15945ee56a14f72f3015a40f0aae35d8ece2bbdbdab47528fca377a760ce869
7
+ data.tar.gz: 7f77e212410056a9db54a6ac350233d44bf220cc6716e59003d53131bb3ea98413826867a97b9e687e262097f41923e48de981baab341c99c2c4cfbdbceb70dd
data/README.md CHANGED
@@ -94,12 +94,13 @@ $ nbdoc basic_pages
94
94
  Endpoint: basic_pages
95
95
  =====================
96
96
 
97
- Method: :index
97
+ Method: index
98
98
  Description: Shows a list of the basic pages in the system
99
- Required parameters: :site_slug
99
+ Required parameters: site_slug
100
100
 
101
- Method: :create
101
+ Method: create
102
102
  Description: Creates a basic page for a site
103
- Required parameters: :site_slug
103
+ Required parameters: site_slug
104
+
104
105
  ...
105
106
  ```
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.1.0
@@ -108,13 +108,13 @@
108
108
  ]
109
109
  },
110
110
  {
111
- "name": "Blogs",
111
+ "name": "Blog Posts",
112
112
  "methods": [
113
113
  {
114
114
  "MethodName": "Index",
115
- "Synopsis": "Shows a list of all blogs",
115
+ "Synopsis": "Shows a list of blog's posts",
116
116
  "HTTPMethod": "GET",
117
- "URI": "/sites/:site_slug/pages/blogs",
117
+ "URI": "/sites/:site_slug/pages/blogs/:id/posts",
118
118
  "parameters": [
119
119
  {
120
120
  "Name": "site_slug",
@@ -123,6 +123,13 @@
123
123
  "Type": "string",
124
124
  "Description": "the site holding the blog"
125
125
  },
126
+ {
127
+ "Name": "id",
128
+ "Required": "Y",
129
+ "Default": null,
130
+ "Type": "int",
131
+ "Description": "the ID of the blog"
132
+ },
126
133
  {
127
134
  "Name": "page",
128
135
  "Required": "N",
@@ -140,10 +147,10 @@
140
147
  ]
141
148
  },
142
149
  {
143
- "MethodName": "Show",
144
- "Synopsis": "Show the details of a blog",
150
+ "MethodName": "Match",
151
+ "Synopsis": "Find a blog post by its external id",
145
152
  "HTTPMethod": "GET",
146
- "URI": "/sites/:site_slug/pages/blogs/:id",
153
+ "URI": "/sites/:site_slug/pages/blogs/:id/match",
147
154
  "parameters": [
148
155
  {
149
156
  "Name": "site_slug",
@@ -158,14 +165,21 @@
158
165
  "Default": null,
159
166
  "Type": "int",
160
167
  "Description": "the ID of the blog"
168
+ },
169
+ {
170
+ "Name": "external_id",
171
+ "Required": "N",
172
+ "Default": "1",
173
+ "Type": "int",
174
+ "Description": "the external id of the post"
161
175
  }
162
176
  ]
163
177
  },
164
178
  {
165
179
  "MethodName": "Create",
166
- "Synopsis": "Creates a new blog",
180
+ "Synopsis": "Creates a new blog post",
167
181
  "HTTPMethod": "POST",
168
- "URI": "/sites/:site_slug/pages/blogs",
182
+ "URI": "/sites/:site_slug/pages/blogs/:blog_id/posts",
169
183
  "parameters": [
170
184
  {
171
185
  "Name": "site_slug",
@@ -174,20 +188,27 @@
174
188
  "Type": "string",
175
189
  "Description": "the site holding the blog"
176
190
  },
191
+ {
192
+ "Name": "blog_id",
193
+ "Required": "Y",
194
+ "Default": null,
195
+ "Type": "int",
196
+ "Description": "the ID of the blog"
197
+ },
177
198
  {
178
199
  "Name": "body",
179
200
  "Required": "Y",
180
201
  "Default": "1",
181
202
  "Type": "json",
182
- "Description": "a JSON representation of the new blog"
203
+ "Description": "a JSON representation of the new post"
183
204
  }
184
205
  ]
185
206
  },
186
207
  {
187
208
  "MethodName": "Update",
188
- "Synopsis": "Updates the attributes of a blog",
209
+ "Synopsis": "Updates the attributes of a blog post",
189
210
  "HTTPMethod": "PUT",
190
- "URI": "/sites/:site_slug/pages/blogs/:id",
211
+ "URI": "/sites/:site_slug/pages/blogs/:blog_id/posts/:blog_post_id",
191
212
  "parameters": [
192
213
  {
193
214
  "Name": "site_slug",
@@ -197,7 +218,14 @@
197
218
  "Description": "the site holding the blog"
198
219
  },
199
220
  {
200
- "Name": "id",
221
+ "Name": "blog_id",
222
+ "Required": "Y",
223
+ "Default": null,
224
+ "Type": "int",
225
+ "Description": "the ID of the blog"
226
+ },
227
+ {
228
+ "Name": "blog_post_id",
201
229
  "Required": "Y",
202
230
  "Default": null,
203
231
  "Type": "int",
@@ -214,9 +242,9 @@
214
242
  },
215
243
  {
216
244
  "MethodName": "Destroy",
217
- "Synopsis": "Removes a blog",
245
+ "Synopsis": "Removes a blog post",
218
246
  "HTTPMethod": "DELETE",
219
- "URI": "/sites/:site_slug/pages/blogs/:id",
247
+ "URI": "/sites/:site_slug/pages/blogs/:blog_id/posts/:blog_post_id",
220
248
  "parameters": [
221
249
  {
222
250
  "Name": "site_slug",
@@ -226,7 +254,14 @@
226
254
  "Description": "the site holding the blog"
227
255
  },
228
256
  {
229
- "Name": "id",
257
+ "Name": "blog_id",
258
+ "Required": "Y",
259
+ "Default": null,
260
+ "Type": "int",
261
+ "Description": "the ID of the blog"
262
+ },
263
+ {
264
+ "Name": "blog_post_id",
230
265
  "Required": "Y",
231
266
  "Default": null,
232
267
  "Type": "int",
@@ -237,13 +272,13 @@
237
272
  ]
238
273
  },
239
274
  {
240
- "name": "Blog Posts",
275
+ "name": "Blogs",
241
276
  "methods": [
242
277
  {
243
278
  "MethodName": "Index",
244
- "Synopsis": "Shows a list of blog's posts",
279
+ "Synopsis": "Shows a list of all blogs",
245
280
  "HTTPMethod": "GET",
246
- "URI": "/sites/:site_slug/pages/blogs/:id/posts",
281
+ "URI": "/sites/:site_slug/pages/blogs",
247
282
  "parameters": [
248
283
  {
249
284
  "Name": "site_slug",
@@ -252,13 +287,6 @@
252
287
  "Type": "string",
253
288
  "Description": "the site holding the blog"
254
289
  },
255
- {
256
- "Name": "id",
257
- "Required": "Y",
258
- "Default": null,
259
- "Type": "int",
260
- "Description": "the ID of the blog"
261
- },
262
290
  {
263
291
  "Name": "page",
264
292
  "Required": "N",
@@ -276,10 +304,10 @@
276
304
  ]
277
305
  },
278
306
  {
279
- "MethodName": "Match",
280
- "Synopsis": "Find a blog post by its external id",
307
+ "MethodName": "Show",
308
+ "Synopsis": "Show the details of a blog",
281
309
  "HTTPMethod": "GET",
282
- "URI": "/sites/:site_slug/pages/blogs/:id/match",
310
+ "URI": "/sites/:site_slug/pages/blogs/:id",
283
311
  "parameters": [
284
312
  {
285
313
  "Name": "site_slug",
@@ -294,21 +322,14 @@
294
322
  "Default": null,
295
323
  "Type": "int",
296
324
  "Description": "the ID of the blog"
297
- },
298
- {
299
- "Name": "external_id",
300
- "Required": "N",
301
- "Default": "1",
302
- "Type": "int",
303
- "Description": "the external id of the post"
304
325
  }
305
326
  ]
306
327
  },
307
328
  {
308
329
  "MethodName": "Create",
309
- "Synopsis": "Creates a new blog post",
330
+ "Synopsis": "Creates a new blog",
310
331
  "HTTPMethod": "POST",
311
- "URI": "/sites/:site_slug/pages/blogs/:blog_id/posts",
332
+ "URI": "/sites/:site_slug/pages/blogs",
312
333
  "parameters": [
313
334
  {
314
335
  "Name": "site_slug",
@@ -317,27 +338,20 @@
317
338
  "Type": "string",
318
339
  "Description": "the site holding the blog"
319
340
  },
320
- {
321
- "Name": "blog_id",
322
- "Required": "Y",
323
- "Default": null,
324
- "Type": "int",
325
- "Description": "the ID of the blog"
326
- },
327
341
  {
328
342
  "Name": "body",
329
343
  "Required": "Y",
330
344
  "Default": "1",
331
345
  "Type": "json",
332
- "Description": "a JSON representation of the new post"
346
+ "Description": "a JSON representation of the new blog"
333
347
  }
334
348
  ]
335
349
  },
336
350
  {
337
351
  "MethodName": "Update",
338
- "Synopsis": "Updates the attributes of a blog post",
352
+ "Synopsis": "Updates the attributes of a blog",
339
353
  "HTTPMethod": "PUT",
340
- "URI": "/sites/:site_slug/pages/blogs/:blog_id/posts/:blog_post_id",
354
+ "URI": "/sites/:site_slug/pages/blogs/:id",
341
355
  "parameters": [
342
356
  {
343
357
  "Name": "site_slug",
@@ -347,14 +361,7 @@
347
361
  "Description": "the site holding the blog"
348
362
  },
349
363
  {
350
- "Name": "blog_id",
351
- "Required": "Y",
352
- "Default": null,
353
- "Type": "int",
354
- "Description": "the ID of the blog"
355
- },
356
- {
357
- "Name": "blog_post_id",
364
+ "Name": "id",
358
365
  "Required": "Y",
359
366
  "Default": null,
360
367
  "Type": "int",
@@ -371,9 +378,9 @@
371
378
  },
372
379
  {
373
380
  "MethodName": "Destroy",
374
- "Synopsis": "Removes a blog post",
381
+ "Synopsis": "Removes a blog",
375
382
  "HTTPMethod": "DELETE",
376
- "URI": "/sites/:site_slug/pages/blogs/:blog_id/posts/:blog_post_id",
383
+ "URI": "/sites/:site_slug/pages/blogs/:id",
377
384
  "parameters": [
378
385
  {
379
386
  "Name": "site_slug",
@@ -383,14 +390,7 @@
383
390
  "Description": "the site holding the blog"
384
391
  },
385
392
  {
386
- "Name": "blog_id",
387
- "Required": "Y",
388
- "Default": null,
389
- "Type": "int",
390
- "Description": "the ID of the blog"
391
- },
392
- {
393
- "Name": "blog_post_id",
393
+ "Name": "id",
394
394
  "Required": "Y",
395
395
  "Default": null,
396
396
  "Type": "int",
@@ -1271,6 +1271,106 @@
1271
1271
  }
1272
1272
  ]
1273
1273
  },
1274
+ {
1275
+ "name": "Memberships",
1276
+ "methods": [
1277
+ {
1278
+ "MethodName": "Index",
1279
+ "Synopsis": "Lists all memberships for a person",
1280
+ "HTTPMethod": "GET",
1281
+ "URI": "/people/:person_id/memberships",
1282
+ "parameters": [
1283
+ {
1284
+ "Name": "person_id",
1285
+ "Required": "Y",
1286
+ "Default": null,
1287
+ "Type": "int",
1288
+ "Description": "The person's ID"
1289
+ },
1290
+ {
1291
+ "Name": "page",
1292
+ "Required": "N",
1293
+ "Default": "1",
1294
+ "Type": "int",
1295
+ "Description": "Which page to return"
1296
+ },
1297
+ {
1298
+ "Name": "per_page",
1299
+ "Required": "N",
1300
+ "Default": "10",
1301
+ "Type": "int",
1302
+ "Description": "The number of listings to return per page"
1303
+ }
1304
+ ]
1305
+ },
1306
+ {
1307
+ "MethodName": "Create",
1308
+ "Synopsis": "Creates a membership",
1309
+ "HTTPMethod": "POST",
1310
+ "URI": "/people/:person_id/memberships",
1311
+ "parameters": [
1312
+ {
1313
+ "Name": "person_id",
1314
+ "Required": "Y",
1315
+ "Default": null,
1316
+ "Type": "int",
1317
+ "Description": "The person's ID"
1318
+ },
1319
+ {
1320
+ "Name": "body",
1321
+ "Required": "Y",
1322
+ "Default": "{}",
1323
+ "Type": "json",
1324
+ "Description": "JSON attributes for the new membership"
1325
+ }
1326
+ ]
1327
+ },
1328
+ {
1329
+ "MethodName": "Update",
1330
+ "Synopsis": "Updates a membership",
1331
+ "HTTPMethod": "PUT",
1332
+ "URI": "/people/:person_id/memberships",
1333
+ "parameters": [
1334
+ {
1335
+ "Name": "person_id",
1336
+ "Required": "Y",
1337
+ "Default": null,
1338
+ "Type": "int",
1339
+ "Description": "The person's ID"
1340
+ },
1341
+ {
1342
+ "Name": "body",
1343
+ "Required": "Y",
1344
+ "Default": "{}",
1345
+ "Type": "json",
1346
+ "Description": "JSON attributes for updating a membership"
1347
+ }
1348
+ ]
1349
+ },
1350
+ {
1351
+ "MethodName": "Destroy",
1352
+ "Synopsis": "Removes a membership from the person",
1353
+ "HTTPMethod": "DELETE",
1354
+ "URI": "/people/:person_id/memberships/:name",
1355
+ "parameters": [
1356
+ {
1357
+ "Name": "person_id",
1358
+ "Required": "Y",
1359
+ "Default": null,
1360
+ "Type": "int",
1361
+ "Description": "The person's ID"
1362
+ },
1363
+ {
1364
+ "Name": "name",
1365
+ "Required": "Y",
1366
+ "Default": null,
1367
+ "Type": "string",
1368
+ "Description": "The name of the membership"
1369
+ }
1370
+ ]
1371
+ }
1372
+ ]
1373
+ },
1274
1374
  {
1275
1375
  "name": "Page Attachments",
1276
1376
  "methods": [
@@ -1911,6 +2011,69 @@
1911
2011
  }
1912
2012
  ]
1913
2013
  },
2014
+ {
2015
+ "name": "Survey Responses",
2016
+ "methods": [
2017
+ {
2018
+ "MethodName": "Index",
2019
+ "Synopsis": "Lists all survey responses",
2020
+ "HTTPMethod": "GET",
2021
+ "URI": "/survey_responses",
2022
+ "parameters": [
2023
+ {
2024
+ "Name": "start_time",
2025
+ "Required": "N",
2026
+ "Default": null,
2027
+ "Type": "string",
2028
+ "Description": "the starting time for results"
2029
+ },
2030
+ {
2031
+ "Name": "end_time",
2032
+ "Required": "N",
2033
+ "Default": null,
2034
+ "Type": "string",
2035
+ "Description": "the ending time for results"
2036
+ },
2037
+ {
2038
+ "Name": "survey_id",
2039
+ "Required": "N",
2040
+ "Default": null,
2041
+ "Type": "int",
2042
+ "Description": "the id for a parent survey"
2043
+ },
2044
+ {
2045
+ "Name": "page",
2046
+ "Required": "N",
2047
+ "Default": "1",
2048
+ "Type": "int",
2049
+ "Description": "result page number"
2050
+ },
2051
+ {
2052
+ "Name": "per_page",
2053
+ "Required": "N",
2054
+ "Default": "10",
2055
+ "Type": "int",
2056
+ "Description": "number of results to return"
2057
+ }
2058
+ ]
2059
+ },
2060
+ {
2061
+ "MethodName": "Create",
2062
+ "Synopsis": "Creates responses for a survey",
2063
+ "HTTPMethod": "POST",
2064
+ "URI": "/survey_responses",
2065
+ "parameters": [
2066
+ {
2067
+ "Name": "body",
2068
+ "Required": "Y",
2069
+ "Default": null,
2070
+ "Type": "json",
2071
+ "Description": "a JSON representation of the survey responses"
2072
+ }
2073
+ ]
2074
+ }
2075
+ ]
2076
+ },
1914
2077
  {
1915
2078
  "name": "Surveys",
1916
2079
  "methods": [
@@ -2018,69 +2181,6 @@
2018
2181
  }
2019
2182
  ]
2020
2183
  },
2021
- {
2022
- "name": "Survey Responses",
2023
- "methods": [
2024
- {
2025
- "MethodName": "Index",
2026
- "Synopsis": "Lists all survey responses",
2027
- "HTTPMethod": "GET",
2028
- "URI": "/survey_responses",
2029
- "parameters": [
2030
- {
2031
- "Name": "start_time",
2032
- "Required": "N",
2033
- "Default": null,
2034
- "Type": "string",
2035
- "Description": "the starting time for results"
2036
- },
2037
- {
2038
- "Name": "end_time",
2039
- "Required": "N",
2040
- "Default": null,
2041
- "Type": "string",
2042
- "Description": "the ending time for results"
2043
- },
2044
- {
2045
- "Name": "survey_id",
2046
- "Required": "N",
2047
- "Default": null,
2048
- "Type": "int",
2049
- "Description": "the id for a parent survey"
2050
- },
2051
- {
2052
- "Name": "page",
2053
- "Required": "N",
2054
- "Default": "1",
2055
- "Type": "int",
2056
- "Description": "result page number"
2057
- },
2058
- {
2059
- "Name": "per_page",
2060
- "Required": "N",
2061
- "Default": "10",
2062
- "Type": "int",
2063
- "Description": "number of results to return"
2064
- }
2065
- ]
2066
- },
2067
- {
2068
- "MethodName": "Create",
2069
- "Synopsis": "Creates responses for a survey",
2070
- "HTTPMethod": "POST",
2071
- "URI": "/survey_responses",
2072
- "parameters": [
2073
- {
2074
- "Name": "body",
2075
- "Required": "Y",
2076
- "Default": null,
2077
- "Type": "json",
2078
- "Description": "a JSON representation of the survey responses"
2079
- }
2080
- ]
2081
- }
2082
- ]
2083
- },
2084
2184
  {
2085
2185
  "name": "Webhooks",
2086
2186
  "methods": [
@@ -101,9 +101,9 @@ class NationBuilder::Client
101
101
  self[endpoint_name].methods.each do |method_name|
102
102
  puts
103
103
  method = self[endpoint_name][method_name]
104
- puts " Method: #{method_name.inspect}"
104
+ puts " Method: #{method_name}"
105
105
  puts " Description: #{method.description}"
106
- required_params = method.parameters.map { |p| p.inspect }
106
+ required_params = method.parameters.map { |p| p }
107
107
  if required_params.any?
108
108
  puts " Required parameters: #{required_params.join(', ')}"
109
109
  end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: nationbuilder-rb 0.0.3 ruby lib
5
+ # stub: nationbuilder-rb 0.1.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "nationbuilder-rb"
9
- s.version = "0.0.3"
9
+ s.version = "0.1.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["David Huie"]
14
- s.date = "2014-07-05"
14
+ s.date = "2014-07-29"
15
15
  s.description = "A Ruby client to the NationBuilder API"
16
16
  s.email = "david@nationbuilder.com"
17
17
  s.executables = ["nbdoc"]
@@ -12,12 +12,12 @@ describe NationBuilder::Client do
12
12
  describe '#endpoints' do
13
13
 
14
14
  it 'should contain all defined endpoints' do
15
- client.endpoints.should eq([:basic_pages, :blogs, :blog_posts,
15
+ client.endpoints.should eq([:basic_pages, :blog_posts, :blogs,
16
16
  :calendars, :campaign_data, :contacts,
17
17
  :contact_types, :donations, :events,
18
- :imports, :lists, :page_attachments,
19
- :people, :people_tags, :sites, :surveys,
20
- :survey_responses, :webhooks])
18
+ :imports, :lists, :memberships, :page_attachments,
19
+ :people, :people_tags, :sites,
20
+ :survey_responses, :surveys, :webhooks])
21
21
  end
22
22
 
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nationbuilder-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Huie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-05 00:00:00.000000000 Z
11
+ date: 2014-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient