wordnik 4.06.01 → 4.06.02

Sign up to get free protection for your applications and to get access to all the features.
@@ -1360,6 +1360,33 @@ module WordMethods
1360
1360
  request_only ? request : request.response.body
1361
1361
  end
1362
1362
 
1363
+ # Internal method to update an audio object
1364
+ #
1365
+ def update_audio_internal(word, body, *args)
1366
+ http_method = :put
1367
+ path = '/word/{word}/audioInternal'
1368
+ path.sub!('{word}', word.to_s)
1369
+
1370
+ # Ruby turns all key-value arguments at the end into a single hash
1371
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
1372
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
1373
+ last_arg = args.pop if args.last.is_a?(Hash)
1374
+ last_arg = args.pop if args.last.is_a?(Array)
1375
+ last_arg ||= {}
1376
+
1377
+ # Look for a kwarg called :request_only, whose presence indicates
1378
+ # that we want the request itself back, not the response body
1379
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
1380
+ request_only = true
1381
+ last_arg.delete(:request_only)
1382
+ end
1383
+
1384
+ params = last_arg
1385
+ body ||= {}
1386
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
1387
+ request_only ? request : request.response.body
1388
+ end
1389
+
1363
1390
  # Deletes an AudioPron
1364
1391
  #
1365
1392
  def delete_audio(word, audio_id, *args)
@@ -326,7 +326,7 @@ module WordListMethods
326
326
  request_only ? request : request.response.body
327
327
  end
328
328
 
329
- # Adds a Tag on a WordList
329
+ # Deletes a tag on a WordList
330
330
  #
331
331
  def delete_word_list_tag(wordListId, *args)
332
332
  http_method = :delete
@@ -110,6 +110,34 @@ module WordListsMethods
110
110
  request_only ? request : request.response.body
111
111
  end
112
112
 
113
+ # Fetches WordList objects containing a word.
114
+ # Results are scoped to the supplied user.
115
+ #
116
+ def find_containing_word(word, *args)
117
+ http_method = :get
118
+ path = '/wordLists/containing/{word}'
119
+ path.sub!('{word}', word.to_s)
120
+
121
+ # Ruby turns all key-value arguments at the end into a single hash
122
+ # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
123
+ # becomes {:limit => 10, :part_of_speech => 'verb'}
124
+ last_arg = args.pop if args.last.is_a?(Hash)
125
+ last_arg = args.pop if args.last.is_a?(Array)
126
+ last_arg ||= {}
127
+
128
+ # Look for a kwarg called :request_only, whose presence indicates
129
+ # that we want the request itself back, not the response body
130
+ if last_arg.is_a?(Hash) && last_arg[:request_only].present?
131
+ request_only = true
132
+ last_arg.delete(:request_only)
133
+ end
134
+
135
+ params = last_arg
136
+ body ||= {}
137
+ request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
138
+ request_only ? request : request.response.body
139
+ end
140
+
113
141
  # Fetches recently created WordList objects.
114
142
  #
115
143
  def find_recent_lists(*args)
@@ -1,4 +1,4 @@
1
1
  module Wordnik
2
- VERSION = "4.06.01"
2
+ VERSION = "4.06.02"
3
3
  end
4
4
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: wordnik
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 4.06.01
5
+ version: 4.06.02
6
6
  platform: ruby
7
7
  authors:
8
8
  - Zeke Sikelianos
@@ -11,8 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-06-19 00:00:00 -07:00
15
- default_executable:
14
+ date: 2011-07-12 00:00:00 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: typhoeus
@@ -175,7 +174,6 @@ files:
175
174
  - spec/spec_helper.rb
176
175
  - spec/wordnik_spec.rb
177
176
  - wordnik.gemspec
178
- has_rdoc: true
179
177
  homepage: http://developer.wordnik.com
180
178
  licenses: []
181
179
 
@@ -199,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
197
  requirements: []
200
198
 
201
199
  rubyforge_project: wordnik
202
- rubygems_version: 1.5.1
200
+ rubygems_version: 1.8.5
203
201
  signing_key:
204
202
  specification_version: 3
205
203
  summary: A ruby wrapper for the Wordnik API