Class: KiriminAja::Config::ClientConfig
- Inherits:
-
Object
- Object
- KiriminAja::Config::ClientConfig
- Defined in:
- lib/kiriminaja/config/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
Instance Method Summary collapse
-
#initialize(env: ENV_SANDBOX, api_key: nil, base_url: nil, http_client: nil) ⇒ ClientConfig
constructor
A new instance of ClientConfig.
- #resolved_base_url ⇒ Object
Constructor Details
#initialize(env: ENV_SANDBOX, api_key: nil, base_url: nil, http_client: nil) ⇒ ClientConfig
Returns a new instance of ClientConfig.
10 11 12 13 14 15 |
# File 'lib/kiriminaja/config/client.rb', line 10 def initialize(env: ENV_SANDBOX, api_key: nil, base_url: nil, http_client: nil) @env = env @api_key = api_key @base_url = base_url || KA_ENV_URL.fetch(env, KA_ENV_URL[ENV_SANDBOX]) @http_client = http_client end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/kiriminaja/config/client.rb', line 8 def api_key @api_key end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
8 9 10 |
# File 'lib/kiriminaja/config/client.rb', line 8 def base_url @base_url end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
8 9 10 |
# File 'lib/kiriminaja/config/client.rb', line 8 def env @env end |
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
8 9 10 |
# File 'lib/kiriminaja/config/client.rb', line 8 def http_client @http_client end |
Instance Method Details
#resolved_base_url ⇒ Object
17 18 19 |
# File 'lib/kiriminaja/config/client.rb', line 17 def resolved_base_url @base_url.chomp("/") end |