oxford_dictionary 1.0.0 → 1.0.1

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
- SHA1:
3
- metadata.gz: 0f3926d3f83c2ba8e1bdd3e8d495d8711477f61c
4
- data.tar.gz: 0c8cb98e9868d75be5472937b73aa8dbb63f2d08
2
+ SHA256:
3
+ metadata.gz: ffecd6360a45c8bdfad1a77ff7e73784e785690c05c87d6d6bb58456c764d716
4
+ data.tar.gz: 4f5ad09e2c4b424d1bb49eae62a5e37b5c3ee2faf2de7cec72c2bbcab2ea3e83
5
5
  SHA512:
6
- metadata.gz: e8834b1e8c46e0dcad3a487f6a8e0fbe9e2da18d3f1e55661ed47d4e65dec6f9fc60603e9afedcb5683fa76cb434d15d239e7c077e474ca1c3156d912d22599f
7
- data.tar.gz: 183e9474dcddd60208adfbc78c60c3c0a6eb65c95f0ec82210538be288687f729dfcc7eb46cdf107f12c3b7849eacf72f7ffea2f2f60ac0c3ce24f7034d661c1
6
+ metadata.gz: 5b3d5945ce79c7e0d36ac8d981b73813c12245870146d68132e0da67ee98a5149994ac8262c48da1951fba09febd39b639e1f603517f3b12e67851601ee92178
7
+ data.tar.gz: 28dbe3edc24b6ec9ede400141a01029e21bdfde2aeadedafc0fedc66dbbdc1051e79c833673dab32c5cf11bc105a770c0e457d750bf4106953f6ae7cc3dc3f0f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## OxfordDictionary master (unreleased)
2
2
 
3
+ ## OxfordDictionary 1.0.1 (2019-05-07)
4
+
5
+ - Deprecate the Wordlist endpoint
6
+ [\#5](https://github.com/swcraig/oxford-dictionary/pull/5)
7
+
3
8
  ## OxfordDictionary 1.0.0 (2017-09-19)
4
9
 
5
10
  - Remove httparty as a runtime dependency
data/README.md CHANGED
@@ -14,10 +14,10 @@ Ruby wrapper to consume the [Oxford Dictionary API](https://developer.oxforddict
14
14
  require 'oxford_dictionary'
15
15
 
16
16
  After registering for an API key, setup the client:
17
-
18
- client = OxfordDictionary::Client.new(app_id: 'ID', app_key: 'SECRET')
19
- client = OxfordDictionary.new(app_id: 'ID', app_key: 'SECRET')
20
-
17
+ ```ruby
18
+ client = OxfordDictionary::Client.new(app_id: 'ID', app_key: 'SECRET')
19
+ client = OxfordDictionary.new(app_id: 'ID', app_key: 'SECRET')
20
+ ```
21
21
  ### Usage Examples
22
22
  Some documentation on the different endpoint function calls can be found [here](http://rubydoc.info/gems/oxford_dictionary/OxfordDictionary/Endpoints)
23
23
 
@@ -25,67 +25,71 @@ This wrapper follows the schema laid out by the API quite closely. The data
25
25
  schema for the different API calls can be found [here](https://developer.oxforddictionaries.com/documentation).
26
26
 
27
27
  ###### Get the results for an entry
28
+ ```ruby
29
+ entry = client.entry('vapid')
28
30
 
29
- entry = client.entry('vapid')
31
+ # Access the first entry
32
+ # Refer to the API documentation for the schema of the returned data structure
33
+ first_lexical_entry = entry.lexical_entries[0]
30
34
 
31
- # Access the first entry
32
- # Refer to the API documentation for the schema of the returned data structure
33
- first_lexical_entry = entry.lexical_entries[0]
35
+ # With some filters
36
+ filters = { lexicalCategory: 'Verb', domains: 'Art'}
37
+ client.entry('truth', filters)
34
38
 
35
- # With some filters
36
- filters = { lexicalCategory: 'Verb', domains: 'Art'}
37
- client.entry('truth', filters)
39
+ # Or do them "inline"
40
+ client.entry('truth', lexicalCategory: 'Verb', domains: 'Art')
38
41
 
39
- # Or do them "inline"
40
- client.entry('truth', lexicalCategory: 'Verb', domains: 'Art')
41
-
42
- # From a dictionary of a specific language (default is 'en')
43
- client.entry('ace', lang: 'es')
42
+ # From a dictionary of a specific language (default is 'en')
43
+ client.entry('ace', lang: 'es')
44
+ ```
44
45
 
45
46
  ###### Or return some subset of information
47
+ ```ruby
48
+ # Like just the examples
49
+ examples = client.entry_examples('explain')
46
50
 
47
- # Like just the examples
48
- examples = client.entry_examples('explain')
49
-
50
- # Or only the pronunciations...
51
- the_noises = client.entry_pronunciations('knight')
51
+ # Or only the pronunciations...
52
+ the_noises = client.entry_pronunciations('knight')
52
53
 
53
- # Or the translations (for Swahili in this example)
54
- en_to_es = client.entry_translations('change', translations: 'sw')
55
- # If no :translations filter is supplied, default is 'es'
54
+ # Or the translations (for Swahili in this example)
55
+ en_to_es = client.entry_translations('change', translations: 'sw')
56
+ # If no :translations filter is supplied, default is 'es'
56
57
 
57
- # Or some of the other documented API calls
58
- client.entry_sentences('scholar')
59
- client.entry_definitions('correct')
60
- client.entry_antonyms_synonyms('monotonous')
61
- # Etc...
58
+ # Or some of the other documented API calls
59
+ client.entry_sentences('scholar')
60
+ client.entry_definitions('correct')
61
+ client.entry_antonyms_synonyms('monotonous')
62
+ # Etc...
62
63
 
63
- # Generally the method names follow the documented API closely
64
+ # Generally the method names follow the documented API closely
65
+ ```
64
66
 
65
67
  ###### Other endpoint calls
68
+ ```ruby
69
+ # Inflections of a word
70
+ inflections = client.inflection('changed')
66
71
 
67
- # Inflections of a word
68
- inflections = client.inflection('changed')
72
+ # Wordlist results (based on categorys, filters, etc...)
73
+ related = client.wordlist(lexicalCategory: 'Noun', word_length: '>5,<10')
69
74
 
70
- # Wordlist results (based on categorys, filters, etc...)
71
- related = client.wordlist(lexicalCategory: 'Noun', word_length: '>5,<10')
72
-
73
- # Or the search endpoint
74
- search_results = client.search('condition', prefix: true)
75
+ # Or the search endpoint
76
+ search_results = client.search('condition', prefix: true)
77
+ ```
75
78
 
76
79
  ###### A quick note on how to add filters to queries
77
80
  There isn't much argument checking at the moment. Some endpoints do not accept filter arguments, refer to the API documentation to check for endpoints that accept filters.
78
-
79
- # All endpoints accept the :lang filter. This specifies which dictionary to use
80
- # If no argument is supplied, default is 'en'
81
- filters = { lang: 'es' }
82
-
83
- # To use multiple values on a single filter, make it an array
84
- filters = { lexicalCategory: ['Noun', 'Verb'] }
85
-
86
- # The wordlist endpoint specifically may include "nested" filters
87
- # These filters (exclude, exclude_senses, etc...) require arrays
88
- filters = { exclude: [domains: %w(sport art)] }
81
+ ```ruby
82
+ # All endpoints accept the :lang filter. This specifies which dictionary to use
83
+ # If no argument is supplied, default is 'en'
84
+ filters = { lang: 'es' }
85
+
86
+ # To use multiple values on a single filter, make it an array
87
+ filters = { lexicalCategory: ['Noun', 'Verb'] }
88
+
89
+ # The wordlist endpoint specifically may include "nested" filters
90
+ # These filters (exclude, exclude_senses, etc...) require arrays
91
+ filters = { exclude: [domains: %w(sport art)] }
92
+ ```
89
93
 
90
94
  Argument names need to be in camelCase, not snake_case. However, the objects returned from API calls use snake_case attributes.
91
95
 
@@ -6,6 +6,8 @@ module OxfordDictionary
6
6
  # Interface to '/wordlist' endpoint
7
7
  module WordlistEndpoint
8
8
  include OxfordDictionary::Request
9
+ extend Gem::Deprecate
10
+
9
11
  ENDPOINT = 'wordlist'.freeze
10
12
  ADVANCED_FILTERS = [:exact, :exclude, :exclude_senses,
11
13
  :exclude_prime_senses, :limit, :offset,
@@ -18,6 +20,7 @@ module OxfordDictionary
18
20
  end
19
21
  ListResponse.new(request(ENDPOINT, nil, params))
20
22
  end
23
+ deprecate :wordlist, :none, 2019, 6
21
24
 
22
25
  private
23
26
 
@@ -1,3 +1,3 @@
1
1
  module OxfordDictionary
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxford_dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - swcraig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-20 00:00:00.000000000 Z
11
+ date: 2019-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.5.1
165
+ rubygems_version: 2.7.4
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: A wrapper for the Oxford Dictionary API