lib/wordnik/resource_modules/glossary.rb in wordnik-4.06.10 vs lib/wordnik/resource_modules/glossary.rb in wordnik-4.06.11
- old
+ new
@@ -1,15 +1,15 @@
# 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
module GlossaryMethods
- # Fetches GlossaryEntry objects for the specified Glossary. The definitions will come as per the dictionary source order. The first definition can be used to give quick overview of the word. If exact match is found, first record from the search result will be the exact match. First record will also have all the data needed to display definition, pronunciation and example usages. if it is exact match.
+ # Fetches a glossary.
#
- def get_glossary_entries(permalinkId, *args)
+ def get_glossary(permalinkId, *args)
http_method = :get
- path = '/glossary/{permalinkId}/search'
+ path = '/glossary/{permalinkId}'
path.sub!('{permalinkId}', permalinkId.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'}
@@ -28,15 +28,15 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Publishes a Glossary.
+ # Updates a Glossary.
#
- def publish_glossary(permalinkId, *args)
- http_method = :post
- path = '/glossary/{permalinkId}/publish'
+ def update_glossary(permalinkId, body, *args)
+ http_method = :put
+ path = '/glossary/{permalinkId}'
path.sub!('{permalinkId}', permalinkId.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'}
@@ -55,15 +55,15 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Creates a new version of a Glossary.
+ # Deletes the Glossary.
#
- def create_version(permalinkId, *args)
- http_method = :post
- path = '/glossary/{permalinkId}/clone'
+ def delete_glossary(permalinkId, *args)
+ http_method = :delete
+ path = '/glossary/{permalinkId}'
path.sub!('{permalinkId}', permalinkId.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'}
@@ -109,17 +109,16 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Removes a GlossaryEntry object from the specified Glossary.
+ # Publishes a Glossary.
#
- def delete_glossary_entry(permalinkId, word, *args)
- http_method = :delete
- path = '/glossary/{permalinkId}/entries/{word}'
+ def publish_glossary(permalinkId, *args)
+ http_method = :post
+ path = '/glossary/{permalinkId}/publish'
path.sub!('{permalinkId}', permalinkId.to_s)
- path.sub!('{word}', word.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)
@@ -137,15 +136,15 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Removes a GlossaryEntry object from the specified Glossary.
+ # Creates a new version of a Glossary.
#
- def delete_glossary_entries(permalinkId, body, *args)
+ def create_version(permalinkId, *args)
http_method = :post
- path = '/glossary/{permalinkId}/deleteEntries'
+ path = '/glossary/{permalinkId}/clone'
path.sub!('{permalinkId}', permalinkId.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'}
@@ -164,16 +163,17 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Fetches a random GlossaryEntry object for the specified Glossary.
+ # Removes a GlossaryEntry object from the specified Glossary.
#
- def get_random_glossary_entry(permalinkId, *args)
- http_method = :get
- path = '/glossary/{permalinkId}/randomEntry'
+ def delete_glossary_entry(permalinkId, word, *args)
+ http_method = :delete
+ path = '/glossary/{permalinkId}/entries/{word}'
path.sub!('{permalinkId}', permalinkId.to_s)
+ path.sub!('{word}', word.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)
@@ -191,15 +191,15 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Fetches the GlossaryEntry object for the specified word in the Glossary.
+ # Removes a GlossaryEntry object from the specified Glossary.
#
- def get_glossary_entry(permalinkId, *args)
- http_method = :get
- path = '/glossary/{permalinkId}/entry'
+ def delete_glossary_entries(permalinkId, body, *args)
+ http_method = :post
+ path = '/glossary/{permalinkId}/deleteEntries'
path.sub!('{permalinkId}', permalinkId.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'}
@@ -218,17 +218,16 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Fetches examples for the Glossary entry
+ # Fetches a random GlossaryEntry object for the specified Glossary.
#
- def get_glossary_entry_examples(permalinkId, word, *args)
+ def get_random_glossary_entry(permalinkId, *args)
http_method = :get
- path = '/glossary/{permalinkId}/{word}/examples'
+ path = '/glossary/{permalinkId}/randomEntry'
path.sub!('{permalinkId}', permalinkId.to_s)
- path.sub!('{word}', word.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)
@@ -246,17 +245,16 @@
body ||= {}
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
request_only ? request : request.response.body
end
- # Fetches audio pronunciation for the given id.
+ # Fetches examples for the Glossary entry
#
- def get_audio_file(permalinkId, word, pronId, *args)
+ def get_glossary_entry_examples(permalinkId, word, *args)
http_method = :get
- path = '/glossary/{permalinkId}/{word}/pronunciation/{pronId}'
+ path = '/glossary/{permalinkId}/entries/{word}/examples'
path.sub!('{permalinkId}', permalinkId.to_s)
path.sub!('{word}', word.to_s)
- path.sub!('{pronId}', pronId.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)
\ No newline at end of file