Class: JishoAPI::Client
- Inherits:
-
Object
- Object
- JishoAPI::Client
- Defined in:
- lib/jisho_api/client.rb
Constant Summary collapse
- URI =
'https://jisho.org/api/v1/search/words'.freeze
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #make_request(params: {}) ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
11 |
# File 'lib/jisho_api/client.rb', line 11 def initialize; end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
7 8 9 |
# File 'lib/jisho_api/client.rb', line 7 def response @response end |
Instance Method Details
#make_request(params: {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jisho_api/client.rb', line 13 def make_request(params: {}) params.merge!(keyword: query) unless params.key?(:keyword) params.merge!(page: page) unless params.key?(:page) invalidate_cached_response! self.response = connection.get do |req| req.params = params end handle_response end |