Module: OxfordDictionary::Endpoints::EntryEndpoint

Includes:
DeprecatedRequest
Included in:
Client
Defined in:
lib/oxford_dictionary/endpoints/entry_endpoint.rb

Overview

Interface to ‘/entries’ endpoint

Constant Summary collapse

ENDPOINT =
'entries'.freeze

Constants included from DeprecatedRequest

DeprecatedRequest::ACCEPT_TYPE, DeprecatedRequest::ADVANCED_FILTERS, DeprecatedRequest::BASE, DeprecatedRequest::HTTP_OK

Instance Method Summary collapse

Methods included from DeprecatedRequest

#request

Instance Method Details

#entry(query, params = {}) ⇒ Object



11
12
13
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 11

def entry(query, params = {})
  entry_request(query, params)
end

#entry_antonyms(query, params = {}) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 70

def entry_antonyms(query, params = {})
  warn '''
  Client#entry_antonyms is DEPRECATED and will become non-functional
  on June 30, 2019. Use Client#thesaurus instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/13 for more
  information. Check out OxfordDictionary::Endpoints::Thesaurus for the
  interface to use. Specifically use it with
  params: { fields: \'antonyms\' }
  '''

  params[:end] = 'antonyms'
  entry_request(query, params)
end

#entry_antonyms_synonyms(query, params = {}) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 98

def entry_antonyms_synonyms(query, params = {})
  warn '''
  Client#entry_antonyms_synonyms is DEPRECATED and will be non-functional
  on June 30, 2019. Use Client#thesaurus instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/14 for more
  information. Check out OxfordDictionary::Endpoints::Thesaurus for the
  interface to use. Specifically use it with
  params: { fields: \'synonyms,antonyms\' }
  '''

  params[:end] = 'synonyms;antonyms'
  entry_request(query, params)
end

#entry_definitions(query, params = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 15

def entry_definitions(query, params = {})
  warn '''
  Client#entry_defintions is DEPRECATED and will become non-functional
  on June 30, 2019. Use Client#entry instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/8 for more
  information. Check out OxfordDictionary::Endpoints::Entries for the
  interface to use. Specifically use it with
  params: { fields: \'definitions\' }
  '''

  params[:end] = 'definitions'
  entry_request(query, params)
end

#entry_examples(query, params = {}) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 29

def entry_examples(query, params = {})
  warn '''
  Client#entry_examples is DEPRECATED and will become non-functional
  on June 30, 2019. Use Client#entry instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/8 for more
  information. Check out OxfordDictionary::Endpoints::Entries for the
  interface to use. Specifically use it with
  params: { fields: \'examples\' }
  '''

  params[:end] = 'examples'
  entry_request(query, params)
end

#entry_pronunciations(query, params = {}) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 43

def entry_pronunciations(query, params = {})
  warn '''
  Client#entry_pronunciations is DEPRECATED and will become non-functional
  on June 30, 2019. Use Client#entry instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/8 for more
  information. Check out OxfordDictionary::Endpoints::Entries for the
  interface to use. Specifically use it with
  params: { fields: \'pronunciations\' }
  '''

  params[:end] = 'pronunciations'
  entry_request(query, params)
end

#entry_sentences(query, params = {}) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 57

def entry_sentences(query, params = {})
  warn '''
  Client#entry_sentences is DEPRECATED and will become non-functional
  on June 30, 2019. Use Client#sentence instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/13 for more
  information. Check out OxfordDictionary::Endpoints::Sentences for the
  interface to use.
  '''

  params[:end] = 'sentences'
  entry_request(query, params)
end

#entry_synonyms(query, params = {}) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 84

def entry_synonyms(query, params = {})
  warn '''
  Client#entry_synonyms is DEPRECATED and will become non-functional
  on June 30, 2019. Use Client#thesaurus instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/13 for more
  information. Check out OxfordDictionary::Endpoints::Thesaurus for the
  interface to use. Specifically use it with
  params: { fields: \'synonyms\' }
  '''

  params[:end] = 'synonyms'
  entry_request(query, params)
end

#entry_translations(query, params = {}) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/oxford_dictionary/endpoints/entry_endpoint.rb', line 112

def entry_translations(query, params = {})
  warn '''
  Client#entry_translations is DEPRECATED and will become non-functional
  on June 30, 2019. Use Client#translation instead. Reference
  https://github.com/swcraig/oxford-dictionary/pull/12 for more
  information. Check out OxfordDictionary::Endpoints::Translations for the
  interface to use.
  '''
  params.key?(:translations) || params[:translations] = 'es'
  entry_request(query, params)
end