Class: SealineInsurance::Config
- Inherits:
-
Object
- Object
- SealineInsurance::Config
- Defined in:
- lib/sealine_insurance/config.rb
Constant Summary collapse
- DEFAULT_HOST =
'dev.sealine.ru'
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#open_timeout ⇒ Object
readonly
Returns the value of attribute open_timeout.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #base_url ⇒ Object
-
#initialize(host: DEFAULT_HOST, token:, timeout: nil, open_timeout: nil, logger: nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(host: DEFAULT_HOST, token:, timeout: nil, open_timeout: nil, logger: nil) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 19 |
# File 'lib/sealine_insurance/config.rb', line 13 def initialize(host: DEFAULT_HOST, token:, timeout: nil, open_timeout: nil, logger: nil) @host = host @token = token @timeout = timeout @open_timeout = open_timeout @logger = logger end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
7 8 9 |
# File 'lib/sealine_insurance/config.rb', line 7 def host @host end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
11 12 13 |
# File 'lib/sealine_insurance/config.rb', line 11 def logger @logger end |
#open_timeout ⇒ Object (readonly)
Returns the value of attribute open_timeout.
10 11 12 |
# File 'lib/sealine_insurance/config.rb', line 10 def open_timeout @open_timeout end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
9 10 11 |
# File 'lib/sealine_insurance/config.rb', line 9 def timeout @timeout end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
8 9 10 |
# File 'lib/sealine_insurance/config.rb', line 8 def token @token end |
Instance Method Details
#base_url ⇒ Object
21 22 23 |
# File 'lib/sealine_insurance/config.rb', line 21 def base_url "https://#{host}/api/v1" end |