Class: Jikanrb::Configuration
- Inherits:
-
Object
- Object
- Jikanrb::Configuration
- Defined in:
- lib/jikanrb/configuration.rb
Overview
Configuration class for Jikanrb client. Allows customization of timeouts, retries, and other HTTP client settings.
Constant Summary collapse
- DEFAULT_BASE_URL =
Base URL for Jikan v4 API
'https://api.jikan.moe/v4'- DEFAULT_OPEN_TIMEOUT =
Default timeouts (in seconds)
5- DEFAULT_READ_TIMEOUT =
10- DEFAULT_MAX_RETRIES =
Rate limit: Jikan allows 60 requests/minute
3- DEFAULT_RETRY_INTERVAL =
1
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#retry_interval ⇒ Object
Returns the value of attribute retry_interval.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
31 32 33 34 35 36 37 38 39 |
# File 'lib/jikanrb/configuration.rb', line 31 def initialize @base_url = DEFAULT_BASE_URL @open_timeout = DEFAULT_OPEN_TIMEOUT @read_timeout = DEFAULT_READ_TIMEOUT @max_retries = DEFAULT_MAX_RETRIES @retry_interval = DEFAULT_RETRY_INTERVAL @user_agent = "Jikanrb Ruby Gem/#{Jikanrb::VERSION}" @logger = nil end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
23 24 25 |
# File 'lib/jikanrb/configuration.rb', line 23 def base_url @base_url end |
#logger ⇒ Object
Returns the value of attribute logger.
23 24 25 |
# File 'lib/jikanrb/configuration.rb', line 23 def logger @logger end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
23 24 25 |
# File 'lib/jikanrb/configuration.rb', line 23 def max_retries @max_retries end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
23 24 25 |
# File 'lib/jikanrb/configuration.rb', line 23 def open_timeout @open_timeout end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
23 24 25 |
# File 'lib/jikanrb/configuration.rb', line 23 def read_timeout @read_timeout end |
#retry_interval ⇒ Object
Returns the value of attribute retry_interval.
23 24 25 |
# File 'lib/jikanrb/configuration.rb', line 23 def retry_interval @retry_interval end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
23 24 25 |
# File 'lib/jikanrb/configuration.rb', line 23 def user_agent @user_agent end |