Class: NseData::HttpClient::FaradayClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- NseData::HttpClient::FaradayClient
- Defined in:
- lib/nse_data/http_client/faraday_client.rb
Overview
FaradayClient class is responsible for making HTTP requests using Faraday.
Instance Method Summary collapse
-
#get(endpoint, force_refresh: false) ⇒ Faraday::Response
Sends a GET request to the specified endpoint.
Methods inherited from BaseClient
Constructor Details
This class inherits a constructor from NseData::HttpClient::BaseClient
Instance Method Details
#get(endpoint, force_refresh: false) ⇒ Faraday::Response
Sends a GET request to the specified endpoint.
17 18 19 20 21 22 23 24 25 |
# File 'lib/nse_data/http_client/faraday_client.rb', line 17 def get(endpoint, force_refresh: false) NseData.logger.debug("#{self.class}##{__method__}: invoking the endpoint #{endpoint}") # Use the cache policy to determine whether to fetch from cache or refresh. @cache_policy.fetch(endpoint, force_refresh:) do handle_connection(endpoint) do |connection| connection.get(endpoint) end end end |