Class: SealineInsurance::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sealine_insurance/config.rb

Constant Summary collapse

DEFAULT_HOST =
'dev.sealine.ru'

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hostObject (readonly)

Returns the value of attribute host.



7
8
9
# File 'lib/sealine_insurance/config.rb', line 7

def host
  @host
end

#loggerObject (readonly)

Returns the value of attribute logger.



11
12
13
# File 'lib/sealine_insurance/config.rb', line 11

def logger
  @logger
end

#open_timeoutObject (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

#timeoutObject (readonly)

Returns the value of attribute timeout.



9
10
11
# File 'lib/sealine_insurance/config.rb', line 9

def timeout
  @timeout
end

#tokenObject (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_urlObject



21
22
23
# File 'lib/sealine_insurance/config.rb', line 21

def base_url
  "https://#{host}/api/v1"
end