Module: WordListMethods
- Defined in:
- lib/wordnik/resource_modules/word_list.rb
Overview
HEY HACKER! THIS IS AN AUTO-GENERATED FILE. So don’t bother editing it. To see how it’s built, take a look at the Rakefile
Instance Method Summary collapse
-
#add_comment_to_word_list(wordListId, body, *args) ⇒ Object
Adds a Comment on a WordList.
-
#add_word_list_tag(wordListId, *args) ⇒ Object
Adds a Tag on a WordList.
-
#add_words_to_word_list(wordListId, body, *args) ⇒ Object
Adds words to a WordList.
-
#delete_word_list(wordListId, *args) ⇒ Object
Deletes an existing WordList.
-
#delete_word_list_comment_by_id(wordListId, commentId, *args) ⇒ Object
Deletes a WordList comment by ID.
-
#delete_word_list_tag(wordListId, *args) ⇒ Object
Deletes a tag on a WordList.
-
#delete_words_from_word_list(wordListId, body, *args) ⇒ Object
Removes words from a WordList.
-
#favorite_word_list(wordListId, *args) ⇒ Object
Favorites a WordList for a User.
-
#get_word_list_by_id(wordListId, *args) ⇒ Object
Fetches a WordList by ID.
-
#get_word_list_comment_by_id(wordListId, commentId, *args) ⇒ Object
Fetches a WordList comment by ID.
-
#get_word_list_comment_count(wordListId, *args) ⇒ Object
Fetches WordList Comment count.
-
#get_word_list_comments(wordListId, *args) ⇒ Object
Fetches comments on a WordList.
-
#get_word_list_tag_count(wordListId, *args) ⇒ Object
Fetches Tag count on a WordList.
-
#get_word_list_tags(wordListId, *args) ⇒ Object
Fetches Tags on a WordList.
-
#get_word_list_words(wordListId, *args) ⇒ Object
Fetches words in a WordList.
-
#get_word_list_words_count(wordListId, *args) ⇒ Object
Gets a count of Words in a WordList.
-
#is_favorite_word_list(wordListId, *args) ⇒ Object
Checks to see if a WordList has been favorited for a user.
-
#un_favorite_word_list(wordListId, *args) ⇒ Object
Unfavorites a WordList for a User.
-
#update_comment_on_word_list(wordListId, body, *args) ⇒ Object
Updates a Comment on a WordList.
-
#update_word_list(wordListId, body, *args) ⇒ Object
Updates an existing WordList.
Instance Method Details
#add_comment_to_word_list(wordListId, body, *args) ⇒ Object
Adds a Comment on a WordList
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 359 def add_comment_to_word_list(wordListId, body, *args) http_method = :post path = '/wordList/{wordListId}/comment' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#add_word_list_tag(wordListId, *args) ⇒ Object
Adds a Tag on a WordList
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 278 def add_word_list_tag(wordListId, *args) http_method = :post path = '/wordList/{wordListId}/tag' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#add_words_to_word_list(wordListId, body, *args) ⇒ Object
Adds words to a WordList
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 89 def add_words_to_word_list(wordListId, body, *args) http_method = :post path = '/wordList/{wordListId}/words' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#delete_word_list(wordListId, *args) ⇒ Object
Deletes an existing WordList
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 35 def delete_word_list(wordListId, *args) http_method = :delete path = '/wordList/{wordListId}' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#delete_word_list_comment_by_id(wordListId, commentId, *args) ⇒ Object
Deletes a WordList comment by ID
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 441 def delete_word_list_comment_by_id(wordListId, commentId, *args) http_method = :delete path = '/wordList/{wordListId}/comment/{commentId}' path.sub!('{wordListId}', wordListId.to_s) path.sub!('{commentId}', commentId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#delete_word_list_tag(wordListId, *args) ⇒ Object
Deletes a tag on a WordList
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 305 def delete_word_list_tag(wordListId, *args) http_method = :delete path = '/wordList/{wordListId}/tag' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#delete_words_from_word_list(wordListId, body, *args) ⇒ Object
Removes words from a WordList
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 496 def delete_words_from_word_list(wordListId, body, *args) http_method = :post path = '/wordList/{wordListId}/deleteWords' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#favorite_word_list(wordListId, *args) ⇒ Object
Favorites a WordList for a User
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 170 def favorite_word_list(wordListId, *args) http_method = :post path = '/wordList/{wordListId}/favorite' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_by_id(wordListId, *args) ⇒ Object
Fetches a WordList by ID
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 62 def get_word_list_by_id(wordListId, *args) http_method = :get path = '/wordList/{wordListId}' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_comment_by_id(wordListId, commentId, *args) ⇒ Object
Fetches a WordList comment by ID
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 413 def get_word_list_comment_by_id(wordListId, commentId, *args) http_method = :get path = '/wordList/{wordListId}/comment/{commentId}' path.sub!('{wordListId}', wordListId.to_s) path.sub!('{commentId}', commentId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_comment_count(wordListId, *args) ⇒ Object
Fetches WordList Comment count
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 469 def get_word_list_comment_count(wordListId, *args) http_method = :get path = '/wordList/{wordListId}/commentCount' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_comments(wordListId, *args) ⇒ Object
Fetches comments on a WordList
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 332 def get_word_list_comments(wordListId, *args) http_method = :get path = '/wordList/{wordListId}/comments' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_tag_count(wordListId, *args) ⇒ Object
Fetches Tag count on a WordList
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 251 def get_word_list_tag_count(wordListId, *args) http_method = :get path = '/wordList/{wordListId}/tagCount' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_tags(wordListId, *args) ⇒ Object
Fetches Tags on a WordList
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 224 def (wordListId, *args) http_method = :get path = '/wordList/{wordListId}/tags' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_words(wordListId, *args) ⇒ Object
Fetches words in a WordList
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 116 def get_word_list_words(wordListId, *args) http_method = :get path = '/wordList/{wordListId}/words' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#get_word_list_words_count(wordListId, *args) ⇒ Object
Gets a count of Words in a WordList
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 523 def get_word_list_words_count(wordListId, *args) http_method = :get path = '/wordList/{wordListId}/wordsCount' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#is_favorite_word_list(wordListId, *args) ⇒ Object
Checks to see if a WordList has been favorited for a user
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 143 def is_favorite_word_list(wordListId, *args) http_method = :get path = '/wordList/{wordListId}/isFavorite' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#un_favorite_word_list(wordListId, *args) ⇒ Object
Unfavorites a WordList for a User
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 197 def un_favorite_word_list(wordListId, *args) http_method = :delete path = '/wordList/{wordListId}/favorite' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#update_comment_on_word_list(wordListId, body, *args) ⇒ Object
Updates a Comment on a WordList
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 386 def update_comment_on_word_list(wordListId, body, *args) http_method = :put path = '/wordList/{wordListId}/comment' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |
#update_word_list(wordListId, body, *args) ⇒ Object
Updates an existing WordList
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/wordnik/resource_modules/word_list.rb', line 8 def update_word_list(wordListId, body, *args) http_method = :put path = '/wordList/{wordListId}' path.sub!('{wordListId}', wordListId.to_s) # Ruby turns all key-value arguments at the end into a single hash # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb') # becomes {:limit => 10, :part_of_speech => 'verb'} last_arg = args.pop if args.last.is_a?(Hash) last_arg = args.pop if args.last.is_a?(Array) last_arg ||= {} # Look for a kwarg called :request_only, whose presence indicates # that we want the request itself back, not the response body if last_arg.is_a?(Hash) && last_arg[:request_only].present? request_only = true last_arg.delete(:request_only) end params = last_arg body ||= {} request = Wordnik::Request.new(http_method, path, :params => params, :body => body) request_only ? request : request.response.body end |