wordnik 4.06.00 → 4.06.01

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,59 @@
1
+ # HEY HACKER! THIS IS AN AUTO-GENERATED FILE.
2
+ # So don't bother editing it. To see how it's built, take a look at the Rakefile
3
+
4
+ module TagMethods
5
+
6
+ # Returns information about API parameters
7
+ #
8
+ def get_help(*args)
9
+ http_method = :get
10
+ path = '/tag'
11
+
12
+ # Ruby turns all key-value arguments at the end into a single hash
13
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
14
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
15
+ last_arg = args.pop if args.last.is_a?(Hash)
16
+ last_arg = args.pop if args.last.is_a?(Array)
17
+ last_arg ||= {}
18
+
19
+ # Look for a kwarg called :request_only, whose presence indicates
20
+ # that we want the request itself back, not the response body
21
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
22
+ request_only = true
23
+ last_arg.delete(:request_only)
24
+ end
25
+
26
+ params = last_arg
27
+ body ||= {}
28
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
29
+ request_only ? request : request.response.body
30
+ end
31
+
32
+ # Fetches Words with a specific Tag.
33
+ #
34
+ def get_words_tagged(tag, *args)
35
+ http_method = :get
36
+ path = '/tag/{tag}/word'
37
+ path.sub!('{tag}', tag.to_s)
38
+
39
+ # Ruby turns all key-value arguments at the end into a single hash
40
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
41
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
42
+ last_arg = args.pop if args.last.is_a?(Hash)
43
+ last_arg = args.pop if args.last.is_a?(Array)
44
+ last_arg ||= {}
45
+
46
+ # Look for a kwarg called :request_only, whose presence indicates
47
+ # that we want the request itself back, not the response body
48
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
49
+ request_only = true
50
+ last_arg.delete(:request_only)
51
+ end
52
+
53
+ params = last_arg
54
+ body ||= {}
55
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
56
+ request_only ? request : request.response.body
57
+ end
58
+
59
+ end
@@ -0,0 +1,1207 @@
1
+ # HEY HACKER! THIS IS AN AUTO-GENERATED FILE.
2
+ # So don't bother editing it. To see how it's built, take a look at the Rakefile
3
+
4
+ module UserMethods
5
+
6
+ # Returns a user's WordOfTheDayList
7
+ #
8
+ def get_word_of_the_day_list(username, *args)
9
+ http_method = :get
10
+ path = '/user/{username}/wordOfTheDayList'
11
+ path.sub!('{username}', username.to_s)
12
+
13
+ # Ruby turns all key-value arguments at the end into a single hash
14
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
15
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
16
+ last_arg = args.pop if args.last.is_a?(Hash)
17
+ last_arg = args.pop if args.last.is_a?(Array)
18
+ last_arg ||= {}
19
+
20
+ # Look for a kwarg called :request_only, whose presence indicates
21
+ # that we want the request itself back, not the response body
22
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
23
+ request_only = true
24
+ last_arg.delete(:request_only)
25
+ end
26
+
27
+ params = last_arg
28
+ body ||= {}
29
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
30
+ request_only ? request : request.response.body
31
+ end
32
+
33
+ # Creates a WordOfTheDayList
34
+ # A user can have only one WordOfTheDayList.
35
+ #
36
+ def create_word_of_the_day_list(username, body, *args)
37
+ http_method = :post
38
+ path = '/user/{username}/wordOfTheDayList'
39
+ path.sub!('{username}', username.to_s)
40
+
41
+ # Ruby turns all key-value arguments at the end into a single hash
42
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
43
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
44
+ last_arg = args.pop if args.last.is_a?(Hash)
45
+ last_arg = args.pop if args.last.is_a?(Array)
46
+ last_arg ||= {}
47
+
48
+ # Look for a kwarg called :request_only, whose presence indicates
49
+ # that we want the request itself back, not the response body
50
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
51
+ request_only = true
52
+ last_arg.delete(:request_only)
53
+ end
54
+
55
+ params = last_arg
56
+ body ||= {}
57
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
58
+ request_only ? request : request.response.body
59
+ end
60
+
61
+ # Updates a user's WordOfTheDayList
62
+ #
63
+ def update_word_of_the_day_list(username, body, *args)
64
+ http_method = :put
65
+ path = '/user/{username}/wordOfTheDayList'
66
+ path.sub!('{username}', username.to_s)
67
+
68
+ # Ruby turns all key-value arguments at the end into a single hash
69
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
70
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
71
+ last_arg = args.pop if args.last.is_a?(Hash)
72
+ last_arg = args.pop if args.last.is_a?(Array)
73
+ last_arg ||= {}
74
+
75
+ # Look for a kwarg called :request_only, whose presence indicates
76
+ # that we want the request itself back, not the response body
77
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
78
+ request_only = true
79
+ last_arg.delete(:request_only)
80
+ end
81
+
82
+ params = last_arg
83
+ body ||= {}
84
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
85
+ request_only ? request : request.response.body
86
+ end
87
+
88
+ # Deletes a user's WordOfTheDayList
89
+ #
90
+ def update_word_of_the_day_list(username, permalink, *args)
91
+ http_method = :delete
92
+ path = '/user/{username}/wordOfTheDayList/{permalink}'
93
+ path.sub!('{username}', username.to_s)
94
+ path.sub!('{permalink}', permalink.to_s)
95
+
96
+ # Ruby turns all key-value arguments at the end into a single hash
97
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
98
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
99
+ last_arg = args.pop if args.last.is_a?(Hash)
100
+ last_arg = args.pop if args.last.is_a?(Array)
101
+ last_arg ||= {}
102
+
103
+ # Look for a kwarg called :request_only, whose presence indicates
104
+ # that we want the request itself back, not the response body
105
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
106
+ request_only = true
107
+ last_arg.delete(:request_only)
108
+ end
109
+
110
+ params = last_arg
111
+ body ||= {}
112
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
113
+ request_only ? request : request.response.body
114
+ end
115
+
116
+ # Adds a WordOfTheDay to a user's WordOfTheDayList
117
+ #
118
+ def update_item_in_word_of_the_day_list(username, permalink, body, *args)
119
+ http_method = :put
120
+ path = '/user/{username}/wordOfTheDayList/{permalink}'
121
+ path.sub!('{username}', username.to_s)
122
+ path.sub!('{permalink}', permalink.to_s)
123
+
124
+ # Ruby turns all key-value arguments at the end into a single hash
125
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
126
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
127
+ last_arg = args.pop if args.last.is_a?(Hash)
128
+ last_arg = args.pop if args.last.is_a?(Array)
129
+ last_arg ||= {}
130
+
131
+ # Look for a kwarg called :request_only, whose presence indicates
132
+ # that we want the request itself back, not the response body
133
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
134
+ request_only = true
135
+ last_arg.delete(:request_only)
136
+ end
137
+
138
+ params = last_arg
139
+ body ||= {}
140
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
141
+ request_only ? request : request.response.body
142
+ end
143
+
144
+ # Returns a UserProfile
145
+ #
146
+ def get_user_profile(username, *args)
147
+ http_method = :get
148
+ path = '/user/{username}/profile'
149
+ path.sub!('{username}', username.to_s)
150
+
151
+ # Ruby turns all key-value arguments at the end into a single hash
152
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
153
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
154
+ last_arg = args.pop if args.last.is_a?(Hash)
155
+ last_arg = args.pop if args.last.is_a?(Array)
156
+ last_arg ||= {}
157
+
158
+ # Look for a kwarg called :request_only, whose presence indicates
159
+ # that we want the request itself back, not the response body
160
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
161
+ request_only = true
162
+ last_arg.delete(:request_only)
163
+ end
164
+
165
+ params = last_arg
166
+ body ||= {}
167
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
168
+ request_only ? request : request.response.body
169
+ end
170
+
171
+ # Updates a UserProfile
172
+ #
173
+ def update_user_profile(username, body, *args)
174
+ http_method = :put
175
+ path = '/user/{username}/profile'
176
+ path.sub!('{username}', username.to_s)
177
+
178
+ # Ruby turns all key-value arguments at the end into a single hash
179
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
180
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
181
+ last_arg = args.pop if args.last.is_a?(Hash)
182
+ last_arg = args.pop if args.last.is_a?(Array)
183
+ last_arg ||= {}
184
+
185
+ # Look for a kwarg called :request_only, whose presence indicates
186
+ # that we want the request itself back, not the response body
187
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
188
+ request_only = true
189
+ last_arg.delete(:request_only)
190
+ end
191
+
192
+ params = last_arg
193
+ body ||= {}
194
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
195
+ request_only ? request : request.response.body
196
+ end
197
+
198
+ # Returns a user's tracking info
199
+ #
200
+ def get_user_tracking_info(username, *args)
201
+ http_method = :get
202
+ path = '/user/{username}/trackingInfo'
203
+ path.sub!('{username}', username.to_s)
204
+
205
+ # Ruby turns all key-value arguments at the end into a single hash
206
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
207
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
208
+ last_arg = args.pop if args.last.is_a?(Hash)
209
+ last_arg = args.pop if args.last.is_a?(Array)
210
+ last_arg ||= {}
211
+
212
+ # Look for a kwarg called :request_only, whose presence indicates
213
+ # that we want the request itself back, not the response body
214
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
215
+ request_only = true
216
+ last_arg.delete(:request_only)
217
+ end
218
+
219
+ params = last_arg
220
+ body ||= {}
221
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
222
+ request_only ? request : request.response.body
223
+ end
224
+
225
+ # Updates a User
226
+ #
227
+ def update_user(username, body, *args)
228
+ http_method = :put
229
+ path = '/user/{username}'
230
+ path.sub!('{username}', username.to_s)
231
+
232
+ # Ruby turns all key-value arguments at the end into a single hash
233
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
234
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
235
+ last_arg = args.pop if args.last.is_a?(Hash)
236
+ last_arg = args.pop if args.last.is_a?(Array)
237
+ last_arg ||= {}
238
+
239
+ # Look for a kwarg called :request_only, whose presence indicates
240
+ # that we want the request itself back, not the response body
241
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
242
+ request_only = true
243
+ last_arg.delete(:request_only)
244
+ end
245
+
246
+ params = last_arg
247
+ body ||= {}
248
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
249
+ request_only ? request : request.response.body
250
+ end
251
+
252
+ # Fetches a User
253
+ #
254
+ def get_user(username, *args)
255
+ http_method = :get
256
+ path = '/user/{username}'
257
+ path.sub!('{username}', username.to_s)
258
+
259
+ # Ruby turns all key-value arguments at the end into a single hash
260
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
261
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
262
+ last_arg = args.pop if args.last.is_a?(Hash)
263
+ last_arg = args.pop if args.last.is_a?(Array)
264
+ last_arg ||= {}
265
+
266
+ # Look for a kwarg called :request_only, whose presence indicates
267
+ # that we want the request itself back, not the response body
268
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
269
+ request_only = true
270
+ last_arg.delete(:request_only)
271
+ end
272
+
273
+ params = last_arg
274
+ body ||= {}
275
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
276
+ request_only ? request : request.response.body
277
+ end
278
+
279
+ # Deletes a User
280
+ #
281
+ def delete_user(username, *args)
282
+ http_method = :delete
283
+ path = '/user/{username}'
284
+ path.sub!('{username}', username.to_s)
285
+
286
+ # Ruby turns all key-value arguments at the end into a single hash
287
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
288
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
289
+ last_arg = args.pop if args.last.is_a?(Hash)
290
+ last_arg = args.pop if args.last.is_a?(Array)
291
+ last_arg ||= {}
292
+
293
+ # Look for a kwarg called :request_only, whose presence indicates
294
+ # that we want the request itself back, not the response body
295
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
296
+ request_only = true
297
+ last_arg.delete(:request_only)
298
+ end
299
+
300
+ params = last_arg
301
+ body ||= {}
302
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
303
+ request_only ? request : request.response.body
304
+ end
305
+
306
+ # Adds an item to a user's WordOfTheDayList
307
+ #
308
+ def add_word_to_word_of_the_day_list(username, permalink, body, *args)
309
+ http_method = :put
310
+ path = '/user/{username}/wordOfTheDayList/{permalink}/add'
311
+ path.sub!('{username}', username.to_s)
312
+ path.sub!('{permalink}', permalink.to_s)
313
+
314
+ # Ruby turns all key-value arguments at the end into a single hash
315
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
316
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
317
+ last_arg = args.pop if args.last.is_a?(Hash)
318
+ last_arg = args.pop if args.last.is_a?(Array)
319
+ last_arg ||= {}
320
+
321
+ # Look for a kwarg called :request_only, whose presence indicates
322
+ # that we want the request itself back, not the response body
323
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
324
+ request_only = true
325
+ last_arg.delete(:request_only)
326
+ end
327
+
328
+ params = last_arg
329
+ body ||= {}
330
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
331
+ request_only ? request : request.response.body
332
+ end
333
+
334
+ # Deletes a specific word from a user's WordOfTheDayList
335
+ #
336
+ def delete_word_from_word_of_the_day_list(username, permalink, wordToDelete, *args)
337
+ http_method = :delete
338
+ path = '/user/{username}/wordOfTheDayList/{permalink}/{wordToDelete}'
339
+ path.sub!('{username}', username.to_s)
340
+ path.sub!('{permalink}', permalink.to_s)
341
+ path.sub!('{wordToDelete}', wordToDelete.to_s)
342
+
343
+ # Ruby turns all key-value arguments at the end into a single hash
344
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
345
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
346
+ last_arg = args.pop if args.last.is_a?(Hash)
347
+ last_arg = args.pop if args.last.is_a?(Array)
348
+ last_arg ||= {}
349
+
350
+ # Look for a kwarg called :request_only, whose presence indicates
351
+ # that we want the request itself back, not the response body
352
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
353
+ request_only = true
354
+ last_arg.delete(:request_only)
355
+ end
356
+
357
+ params = last_arg
358
+ body ||= {}
359
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
360
+ request_only ? request : request.response.body
361
+ end
362
+
363
+ # Returns the WordOfTheDay for a given user on a given date
364
+ #
365
+ def get_word_of_the_day_by_date(username, date, *args)
366
+ http_method = :get
367
+ path = '/user/{username}/wordOfTheDay/{date}'
368
+ path.sub!('{username}', username.to_s)
369
+ path.sub!('{date}', date.to_s)
370
+
371
+ # Ruby turns all key-value arguments at the end into a single hash
372
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
373
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
374
+ last_arg = args.pop if args.last.is_a?(Hash)
375
+ last_arg = args.pop if args.last.is_a?(Array)
376
+ last_arg ||= {}
377
+
378
+ # Look for a kwarg called :request_only, whose presence indicates
379
+ # that we want the request itself back, not the response body
380
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
381
+ request_only = true
382
+ last_arg.delete(:request_only)
383
+ end
384
+
385
+ params = last_arg
386
+ body ||= {}
387
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
388
+ request_only ? request : request.response.body
389
+ end
390
+
391
+ # Gets WordLists for a User.
392
+ #
393
+ def get_user_word_lists(username, *args)
394
+ http_method = :get
395
+ path = '/user/{username}/wordLists'
396
+ path.sub!('{username}', username.to_s)
397
+
398
+ # Ruby turns all key-value arguments at the end into a single hash
399
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
400
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
401
+ last_arg = args.pop if args.last.is_a?(Hash)
402
+ last_arg = args.pop if args.last.is_a?(Array)
403
+ last_arg ||= {}
404
+
405
+ # Look for a kwarg called :request_only, whose presence indicates
406
+ # that we want the request itself back, not the response body
407
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
408
+ request_only = true
409
+ last_arg.delete(:request_only)
410
+ end
411
+
412
+ params = last_arg
413
+ body ||= {}
414
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
415
+ request_only ? request : request.response.body
416
+ end
417
+
418
+ # Gets the count of WordLists for a User.
419
+ #
420
+ def get_user_word_list_count(username, *args)
421
+ http_method = :get
422
+ path = '/user/{username}/wordListsCount'
423
+ path.sub!('{username}', username.to_s)
424
+
425
+ # Ruby turns all key-value arguments at the end into a single hash
426
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
427
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
428
+ last_arg = args.pop if args.last.is_a?(Hash)
429
+ last_arg = args.pop if args.last.is_a?(Array)
430
+ last_arg ||= {}
431
+
432
+ # Look for a kwarg called :request_only, whose presence indicates
433
+ # that we want the request itself back, not the response body
434
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
435
+ request_only = true
436
+ last_arg.delete(:request_only)
437
+ end
438
+
439
+ params = last_arg
440
+ body ||= {}
441
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
442
+ request_only ? request : request.response.body
443
+ end
444
+
445
+ # Returns a user's settings
446
+ #
447
+ def get_user_settings(username, *args)
448
+ http_method = :get
449
+ path = '/user/{username}/settings'
450
+ path.sub!('{username}', username.to_s)
451
+
452
+ # Ruby turns all key-value arguments at the end into a single hash
453
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
454
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
455
+ last_arg = args.pop if args.last.is_a?(Hash)
456
+ last_arg = args.pop if args.last.is_a?(Array)
457
+ last_arg ||= {}
458
+
459
+ # Look for a kwarg called :request_only, whose presence indicates
460
+ # that we want the request itself back, not the response body
461
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
462
+ request_only = true
463
+ last_arg.delete(:request_only)
464
+ end
465
+
466
+ params = last_arg
467
+ body ||= {}
468
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
469
+ request_only ? request : request.response.body
470
+ end
471
+
472
+ # Updates a user's settings
473
+ #
474
+ def update_user_settings(username, body, *args)
475
+ http_method = :put
476
+ path = '/user/{username}/settings'
477
+ path.sub!('{username}', username.to_s)
478
+
479
+ # Ruby turns all key-value arguments at the end into a single hash
480
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
481
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
482
+ last_arg = args.pop if args.last.is_a?(Hash)
483
+ last_arg = args.pop if args.last.is_a?(Array)
484
+ last_arg ||= {}
485
+
486
+ # Look for a kwarg called :request_only, whose presence indicates
487
+ # that we want the request itself back, not the response body
488
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
489
+ request_only = true
490
+ last_arg.delete(:request_only)
491
+ end
492
+
493
+ params = last_arg
494
+ body ||= {}
495
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
496
+ request_only ? request : request.response.body
497
+ end
498
+
499
+ # Returns the API key for the specified user
500
+ # Use the super user API key for getting this information or auth token of the user who is requesting the API key
501
+ #
502
+ def get_api_key_for_user(username, *args)
503
+ http_method = :get
504
+ path = '/user/{username}/apiKey'
505
+ path.sub!('{username}', username.to_s)
506
+
507
+ # Ruby turns all key-value arguments at the end into a single hash
508
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
509
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
510
+ last_arg = args.pop if args.last.is_a?(Hash)
511
+ last_arg = args.pop if args.last.is_a?(Array)
512
+ last_arg ||= {}
513
+
514
+ # Look for a kwarg called :request_only, whose presence indicates
515
+ # that we want the request itself back, not the response body
516
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
517
+ request_only = true
518
+ last_arg.delete(:request_only)
519
+ end
520
+
521
+ params = last_arg
522
+ body ||= {}
523
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
524
+ request_only ? request : request.response.body
525
+ end
526
+
527
+ # Adds a Comment on a User
528
+ #
529
+ def comment_on_user(username, body, *args)
530
+ http_method = :post
531
+ path = '/user/{username}/comment'
532
+ path.sub!('{username}', username.to_s)
533
+
534
+ # Ruby turns all key-value arguments at the end into a single hash
535
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
536
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
537
+ last_arg = args.pop if args.last.is_a?(Hash)
538
+ last_arg = args.pop if args.last.is_a?(Array)
539
+ last_arg ||= {}
540
+
541
+ # Look for a kwarg called :request_only, whose presence indicates
542
+ # that we want the request itself back, not the response body
543
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
544
+ request_only = true
545
+ last_arg.delete(:request_only)
546
+ end
547
+
548
+ params = last_arg
549
+ body ||= {}
550
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
551
+ request_only ? request : request.response.body
552
+ end
553
+
554
+ # Updates a Comment on a User
555
+ #
556
+ def update_comment_on_user(username, body, *args)
557
+ http_method = :put
558
+ path = '/user/{username}/comment'
559
+ path.sub!('{username}', username.to_s)
560
+
561
+ # Ruby turns all key-value arguments at the end into a single hash
562
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
563
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
564
+ last_arg = args.pop if args.last.is_a?(Hash)
565
+ last_arg = args.pop if args.last.is_a?(Array)
566
+ last_arg ||= {}
567
+
568
+ # Look for a kwarg called :request_only, whose presence indicates
569
+ # that we want the request itself back, not the response body
570
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
571
+ request_only = true
572
+ last_arg.delete(:request_only)
573
+ end
574
+
575
+ params = last_arg
576
+ body ||= {}
577
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
578
+ request_only ? request : request.response.body
579
+ end
580
+
581
+ # Deletes a Comment on a User
582
+ #
583
+ def delete_comment_on_user(username, commentId, *args)
584
+ http_method = :delete
585
+ path = '/user/{username}/comment/{commentId}'
586
+ path.sub!('{username}', username.to_s)
587
+ path.sub!('{commentId}', commentId.to_s)
588
+
589
+ # Ruby turns all key-value arguments at the end into a single hash
590
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
591
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
592
+ last_arg = args.pop if args.last.is_a?(Hash)
593
+ last_arg = args.pop if args.last.is_a?(Array)
594
+ last_arg ||= {}
595
+
596
+ # Look for a kwarg called :request_only, whose presence indicates
597
+ # that we want the request itself back, not the response body
598
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
599
+ request_only = true
600
+ last_arg.delete(:request_only)
601
+ end
602
+
603
+ params = last_arg
604
+ body ||= {}
605
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
606
+ request_only ? request : request.response.body
607
+ end
608
+
609
+ # Fetches a comment by ID
610
+ #
611
+ def get_comment_on_user_by_id(username, commentId, *args)
612
+ http_method = :get
613
+ path = '/user/{username}/comment/{commentId}'
614
+ path.sub!('{username}', username.to_s)
615
+ path.sub!('{commentId}', commentId.to_s)
616
+
617
+ # Ruby turns all key-value arguments at the end into a single hash
618
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
619
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
620
+ last_arg = args.pop if args.last.is_a?(Hash)
621
+ last_arg = args.pop if args.last.is_a?(Array)
622
+ last_arg ||= {}
623
+
624
+ # Look for a kwarg called :request_only, whose presence indicates
625
+ # that we want the request itself back, not the response body
626
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
627
+ request_only = true
628
+ last_arg.delete(:request_only)
629
+ end
630
+
631
+ params = last_arg
632
+ body ||= {}
633
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
634
+ request_only ? request : request.response.body
635
+ end
636
+
637
+ # Returns a count of Comments on a user
638
+ #
639
+ def get_comments_on_user_count(username, *args)
640
+ http_method = :get
641
+ path = '/user/{username}/commentsOnCount'
642
+ path.sub!('{username}', username.to_s)
643
+
644
+ # Ruby turns all key-value arguments at the end into a single hash
645
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
646
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
647
+ last_arg = args.pop if args.last.is_a?(Hash)
648
+ last_arg = args.pop if args.last.is_a?(Array)
649
+ last_arg ||= {}
650
+
651
+ # Look for a kwarg called :request_only, whose presence indicates
652
+ # that we want the request itself back, not the response body
653
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
654
+ request_only = true
655
+ last_arg.delete(:request_only)
656
+ end
657
+
658
+ params = last_arg
659
+ body ||= {}
660
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
661
+ request_only ? request : request.response.body
662
+ end
663
+
664
+ # Returns a count of Comments by a user
665
+ #
666
+ def get_comments_by_user_count(username, *args)
667
+ http_method = :get
668
+ path = '/user/{username}/commentsByCount'
669
+ path.sub!('{username}', username.to_s)
670
+
671
+ # Ruby turns all key-value arguments at the end into a single hash
672
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
673
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
674
+ last_arg = args.pop if args.last.is_a?(Hash)
675
+ last_arg = args.pop if args.last.is_a?(Array)
676
+ last_arg ||= {}
677
+
678
+ # Look for a kwarg called :request_only, whose presence indicates
679
+ # that we want the request itself back, not the response body
680
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
681
+ request_only = true
682
+ last_arg.delete(:request_only)
683
+ end
684
+
685
+ params = last_arg
686
+ body ||= {}
687
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
688
+ request_only ? request : request.response.body
689
+ end
690
+
691
+ # Returns Comments by a user
692
+ #
693
+ def get_comments_by_user(username, *args)
694
+ http_method = :get
695
+ path = '/user/{username}/commentsBy'
696
+ path.sub!('{username}', username.to_s)
697
+
698
+ # Ruby turns all key-value arguments at the end into a single hash
699
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
700
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
701
+ last_arg = args.pop if args.last.is_a?(Hash)
702
+ last_arg = args.pop if args.last.is_a?(Array)
703
+ last_arg ||= {}
704
+
705
+ # Look for a kwarg called :request_only, whose presence indicates
706
+ # that we want the request itself back, not the response body
707
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
708
+ request_only = true
709
+ last_arg.delete(:request_only)
710
+ end
711
+
712
+ params = last_arg
713
+ body ||= {}
714
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
715
+ request_only ? request : request.response.body
716
+ end
717
+
718
+ # Returns Comments on a user
719
+ #
720
+ def get_comments_on_user(username, *args)
721
+ http_method = :get
722
+ path = '/user/{username}/commentsOnUser'
723
+ path.sub!('{username}', username.to_s)
724
+
725
+ # Ruby turns all key-value arguments at the end into a single hash
726
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
727
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
728
+ last_arg = args.pop if args.last.is_a?(Hash)
729
+ last_arg = args.pop if args.last.is_a?(Array)
730
+ last_arg ||= {}
731
+
732
+ # Look for a kwarg called :request_only, whose presence indicates
733
+ # that we want the request itself back, not the response body
734
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
735
+ request_only = true
736
+ last_arg.delete(:request_only)
737
+ end
738
+
739
+ params = last_arg
740
+ body ||= {}
741
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
742
+ request_only ? request : request.response.body
743
+ end
744
+
745
+ # Returns UgcSummary info a user
746
+ #
747
+ def get_ugc_summary_for_user(username, *args)
748
+ http_method = :get
749
+ path = '/user/{username}/ugcSummary'
750
+ path.sub!('{username}', username.to_s)
751
+
752
+ # Ruby turns all key-value arguments at the end into a single hash
753
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
754
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
755
+ last_arg = args.pop if args.last.is_a?(Hash)
756
+ last_arg = args.pop if args.last.is_a?(Array)
757
+ last_arg ||= {}
758
+
759
+ # Look for a kwarg called :request_only, whose presence indicates
760
+ # that we want the request itself back, not the response body
761
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
762
+ request_only = true
763
+ last_arg.delete(:request_only)
764
+ end
765
+
766
+ params = last_arg
767
+ body ||= {}
768
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
769
+ request_only ? request : request.response.body
770
+ end
771
+
772
+ # Fetches TagHistory for a User.
773
+ #
774
+ def get_user_tag_history(user, *args)
775
+ http_method = :get
776
+ path = '/user/{user}/tagHistory'
777
+ path.sub!('{user}', user.to_s)
778
+
779
+ # Ruby turns all key-value arguments at the end into a single hash
780
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
781
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
782
+ last_arg = args.pop if args.last.is_a?(Hash)
783
+ last_arg = args.pop if args.last.is_a?(Array)
784
+ last_arg ||= {}
785
+
786
+ # Look for a kwarg called :request_only, whose presence indicates
787
+ # that we want the request itself back, not the response body
788
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
789
+ request_only = true
790
+ last_arg.delete(:request_only)
791
+ end
792
+
793
+ params = last_arg
794
+ body ||= {}
795
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
796
+ request_only ? request : request.response.body
797
+ end
798
+
799
+ # Fetches Tags by a User.
800
+ #
801
+ def get_user_tags(user, *args)
802
+ http_method = :get
803
+ path = '/user/{user}/tags'
804
+ path.sub!('{user}', user.to_s)
805
+
806
+ # Ruby turns all key-value arguments at the end into a single hash
807
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
808
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
809
+ last_arg = args.pop if args.last.is_a?(Hash)
810
+ last_arg = args.pop if args.last.is_a?(Array)
811
+ last_arg ||= {}
812
+
813
+ # Look for a kwarg called :request_only, whose presence indicates
814
+ # that we want the request itself back, not the response body
815
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
816
+ request_only = true
817
+ last_arg.delete(:request_only)
818
+ end
819
+
820
+ params = last_arg
821
+ body ||= {}
822
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
823
+ request_only ? request : request.response.body
824
+ end
825
+
826
+ # Fetches the count of Tags created by a User.
827
+ #
828
+ def get_user_tag_count(user, *args)
829
+ http_method = :get
830
+ path = '/user/{user}/tagCount'
831
+ path.sub!('{user}', user.to_s)
832
+
833
+ # Ruby turns all key-value arguments at the end into a single hash
834
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
835
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
836
+ last_arg = args.pop if args.last.is_a?(Hash)
837
+ last_arg = args.pop if args.last.is_a?(Array)
838
+ last_arg ||= {}
839
+
840
+ # Look for a kwarg called :request_only, whose presence indicates
841
+ # that we want the request itself back, not the response body
842
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
843
+ request_only = true
844
+ last_arg.delete(:request_only)
845
+ end
846
+
847
+ params = last_arg
848
+ body ||= {}
849
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
850
+ request_only ? request : request.response.body
851
+ end
852
+
853
+ # Fetches all subscriptions for a User.
854
+ #
855
+ def get_subscriptions(user, *args)
856
+ http_method = :get
857
+ path = '/user/{user}/subscriptions'
858
+ path.sub!('{user}', user.to_s)
859
+
860
+ # Ruby turns all key-value arguments at the end into a single hash
861
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
862
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
863
+ last_arg = args.pop if args.last.is_a?(Hash)
864
+ last_arg = args.pop if args.last.is_a?(Array)
865
+ last_arg ||= {}
866
+
867
+ # Look for a kwarg called :request_only, whose presence indicates
868
+ # that we want the request itself back, not the response body
869
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
870
+ request_only = true
871
+ last_arg.delete(:request_only)
872
+ end
873
+
874
+ params = last_arg
875
+ body ||= {}
876
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
877
+ request_only ? request : request.response.body
878
+ end
879
+
880
+ # Subscribes to an object.
881
+ #
882
+ def add_subscription(user, objectType, objectIdentifier, *args)
883
+ http_method = :post
884
+ path = '/user/{user}/subscriptions/{objectType}/{objectIdentifier}'
885
+ path.sub!('{user}', user.to_s)
886
+ path.sub!('{objectType}', objectType.to_s)
887
+ path.sub!('{objectIdentifier}', objectIdentifier.to_s)
888
+
889
+ # Ruby turns all key-value arguments at the end into a single hash
890
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
891
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
892
+ last_arg = args.pop if args.last.is_a?(Hash)
893
+ last_arg = args.pop if args.last.is_a?(Array)
894
+ last_arg ||= {}
895
+
896
+ # Look for a kwarg called :request_only, whose presence indicates
897
+ # that we want the request itself back, not the response body
898
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
899
+ request_only = true
900
+ last_arg.delete(:request_only)
901
+ end
902
+
903
+ params = last_arg
904
+ body ||= {}
905
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
906
+ request_only ? request : request.response.body
907
+ end
908
+
909
+ # Deletes a subscription to an object.
910
+ #
911
+ def remove_subscription(user, objectType, objectIdentifier, *args)
912
+ http_method = :delete
913
+ path = '/user/{user}/subscriptions/{objectType}/{objectIdentifier}'
914
+ path.sub!('{user}', user.to_s)
915
+ path.sub!('{objectType}', objectType.to_s)
916
+ path.sub!('{objectIdentifier}', objectIdentifier.to_s)
917
+
918
+ # Ruby turns all key-value arguments at the end into a single hash
919
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
920
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
921
+ last_arg = args.pop if args.last.is_a?(Hash)
922
+ last_arg = args.pop if args.last.is_a?(Array)
923
+ last_arg ||= {}
924
+
925
+ # Look for a kwarg called :request_only, whose presence indicates
926
+ # that we want the request itself back, not the response body
927
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
928
+ request_only = true
929
+ last_arg.delete(:request_only)
930
+ end
931
+
932
+ params = last_arg
933
+ body ||= {}
934
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
935
+ request_only ? request : request.response.body
936
+ end
937
+
938
+ # Fetches Favorite Words for a user.
939
+ #
940
+ def get_user_favorite_words(user, *args)
941
+ http_method = :get
942
+ path = '/user/{user}/favorites/words'
943
+ path.sub!('{user}', user.to_s)
944
+
945
+ # Ruby turns all key-value arguments at the end into a single hash
946
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
947
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
948
+ last_arg = args.pop if args.last.is_a?(Hash)
949
+ last_arg = args.pop if args.last.is_a?(Array)
950
+ last_arg ||= {}
951
+
952
+ # Look for a kwarg called :request_only, whose presence indicates
953
+ # that we want the request itself back, not the response body
954
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
955
+ request_only = true
956
+ last_arg.delete(:request_only)
957
+ end
958
+
959
+ params = last_arg
960
+ body ||= {}
961
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
962
+ request_only ? request : request.response.body
963
+ end
964
+
965
+ # Fetches favorite word count for a user.
966
+ #
967
+ def get_user_favorite_count(user, *args)
968
+ http_method = :get
969
+ path = '/user/{user}/favorites/wordCount'
970
+ path.sub!('{user}', user.to_s)
971
+
972
+ # Ruby turns all key-value arguments at the end into a single hash
973
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
974
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
975
+ last_arg = args.pop if args.last.is_a?(Hash)
976
+ last_arg = args.pop if args.last.is_a?(Array)
977
+ last_arg ||= {}
978
+
979
+ # Look for a kwarg called :request_only, whose presence indicates
980
+ # that we want the request itself back, not the response body
981
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
982
+ request_only = true
983
+ last_arg.delete(:request_only)
984
+ end
985
+
986
+ params = last_arg
987
+ body ||= {}
988
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
989
+ request_only ? request : request.response.body
990
+ end
991
+
992
+ # Fetches Favorite WordLists for a user.
993
+ #
994
+ def get_user_favorite_word_lists(user, *args)
995
+ http_method = :get
996
+ path = '/user/{user}/favorites/wordLists'
997
+ path.sub!('{user}', user.to_s)
998
+
999
+ # Ruby turns all key-value arguments at the end into a single hash
1000
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1001
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1002
+ last_arg = args.pop if args.last.is_a?(Hash)
1003
+ last_arg = args.pop if args.last.is_a?(Array)
1004
+ last_arg ||= {}
1005
+
1006
+ # Look for a kwarg called :request_only, whose presence indicates
1007
+ # that we want the request itself back, not the response body
1008
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1009
+ request_only = true
1010
+ last_arg.delete(:request_only)
1011
+ end
1012
+
1013
+ params = last_arg
1014
+ body ||= {}
1015
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1016
+ request_only ? request : request.response.body
1017
+ end
1018
+
1019
+ # Fetches Favorite WordList count for a user.
1020
+ #
1021
+ def get_user_favorite_word_lists_count(user, *args)
1022
+ http_method = :get
1023
+ path = '/user/{user}/favorites/wordListCount'
1024
+ path.sub!('{user}', user.to_s)
1025
+
1026
+ # Ruby turns all key-value arguments at the end into a single hash
1027
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1028
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1029
+ last_arg = args.pop if args.last.is_a?(Hash)
1030
+ last_arg = args.pop if args.last.is_a?(Array)
1031
+ last_arg ||= {}
1032
+
1033
+ # Look for a kwarg called :request_only, whose presence indicates
1034
+ # that we want the request itself back, not the response body
1035
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1036
+ request_only = true
1037
+ last_arg.delete(:request_only)
1038
+ end
1039
+
1040
+ params = last_arg
1041
+ body ||= {}
1042
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1043
+ request_only ? request : request.response.body
1044
+ end
1045
+
1046
+ # Fetches SearchHistory for a User.
1047
+ #
1048
+ def get_user_search_history(user, *args)
1049
+ http_method = :get
1050
+ path = '/user/{user}/searches'
1051
+ path.sub!('{user}', user.to_s)
1052
+
1053
+ # Ruby turns all key-value arguments at the end into a single hash
1054
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1055
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1056
+ last_arg = args.pop if args.last.is_a?(Hash)
1057
+ last_arg = args.pop if args.last.is_a?(Array)
1058
+ last_arg ||= {}
1059
+
1060
+ # Look for a kwarg called :request_only, whose presence indicates
1061
+ # that we want the request itself back, not the response body
1062
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1063
+ request_only = true
1064
+ last_arg.delete(:request_only)
1065
+ end
1066
+
1067
+ params = last_arg
1068
+ body ||= {}
1069
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1070
+ request_only ? request : request.response.body
1071
+ end
1072
+
1073
+ # Fetches SearchHistory for a User.
1074
+ #
1075
+ def remove_user_search_history_item(user, *args)
1076
+ http_method = :delete
1077
+ path = '/user/{user}/searches'
1078
+ path.sub!('{user}', user.to_s)
1079
+
1080
+ # Ruby turns all key-value arguments at the end into a single hash
1081
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1082
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1083
+ last_arg = args.pop if args.last.is_a?(Hash)
1084
+ last_arg = args.pop if args.last.is_a?(Array)
1085
+ last_arg ||= {}
1086
+
1087
+ # Look for a kwarg called :request_only, whose presence indicates
1088
+ # that we want the request itself back, not the response body
1089
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1090
+ request_only = true
1091
+ last_arg.delete(:request_only)
1092
+ end
1093
+
1094
+ params = last_arg
1095
+ body ||= {}
1096
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1097
+ request_only ? request : request.response.body
1098
+ end
1099
+
1100
+ # Fetches the total search count for a User.
1101
+ #
1102
+ def get_user_search_history_count(user, *args)
1103
+ http_method = :get
1104
+ path = '/user/{user}/totalSearches'
1105
+ path.sub!('{user}', user.to_s)
1106
+
1107
+ # Ruby turns all key-value arguments at the end into a single hash
1108
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1109
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1110
+ last_arg = args.pop if args.last.is_a?(Hash)
1111
+ last_arg = args.pop if args.last.is_a?(Array)
1112
+ last_arg ||= {}
1113
+
1114
+ # Look for a kwarg called :request_only, whose presence indicates
1115
+ # that we want the request itself back, not the response body
1116
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1117
+ request_only = true
1118
+ last_arg.delete(:request_only)
1119
+ end
1120
+
1121
+ params = last_arg
1122
+ body ||= {}
1123
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1124
+ request_only ? request : request.response.body
1125
+ end
1126
+
1127
+ # Fetches the total search count for a User.
1128
+ #
1129
+ def get_user_pronunciations(user, *args)
1130
+ http_method = :get
1131
+ path = '/user/{user}/pronunciations'
1132
+ path.sub!('{user}', user.to_s)
1133
+
1134
+ # Ruby turns all key-value arguments at the end into a single hash
1135
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1136
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1137
+ last_arg = args.pop if args.last.is_a?(Hash)
1138
+ last_arg = args.pop if args.last.is_a?(Array)
1139
+ last_arg ||= {}
1140
+
1141
+ # Look for a kwarg called :request_only, whose presence indicates
1142
+ # that we want the request itself back, not the response body
1143
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1144
+ request_only = true
1145
+ last_arg.delete(:request_only)
1146
+ end
1147
+
1148
+ params = last_arg
1149
+ body ||= {}
1150
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1151
+ request_only ? request : request.response.body
1152
+ end
1153
+
1154
+ # Fetches the total search count for a User.
1155
+ #
1156
+ def get_user_activity_stream(user, *args)
1157
+ http_method = :get
1158
+ path = '/user/{user}/activitystream'
1159
+ path.sub!('{user}', user.to_s)
1160
+
1161
+ # Ruby turns all key-value arguments at the end into a single hash
1162
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1163
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1164
+ last_arg = args.pop if args.last.is_a?(Hash)
1165
+ last_arg = args.pop if args.last.is_a?(Array)
1166
+ last_arg ||= {}
1167
+
1168
+ # Look for a kwarg called :request_only, whose presence indicates
1169
+ # that we want the request itself back, not the response body
1170
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1171
+ request_only = true
1172
+ last_arg.delete(:request_only)
1173
+ end
1174
+
1175
+ params = last_arg
1176
+ body ||= {}
1177
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1178
+ request_only ? request : request.response.body
1179
+ end
1180
+
1181
+ # Returns information about API parameters
1182
+ #
1183
+ def get_help(*args)
1184
+ http_method = :get
1185
+ path = '/user'
1186
+
1187
+ # Ruby turns all key-value arguments at the end into a single hash
1188
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1189
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1190
+ last_arg = args.pop if args.last.is_a?(Hash)
1191
+ last_arg = args.pop if args.last.is_a?(Array)
1192
+ last_arg ||= {}
1193
+
1194
+ # Look for a kwarg called :request_only, whose presence indicates
1195
+ # that we want the request itself back, not the response body
1196
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1197
+ request_only = true
1198
+ last_arg.delete(:request_only)
1199
+ end
1200
+
1201
+ params = last_arg
1202
+ body ||= {}
1203
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1204
+ request_only ? request : request.response.body
1205
+ end
1206
+
1207
+ end