Class: Bakong::OpenApi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bakong/open_api/configuration.rb

Overview

Client-wide configuration. Either passed to Client.new explicitly or mutated via Bakong::OpenApi.configure { |c| … } for a thread-local default singleton.

Constant Summary collapse

DEFAULT_BASE_URL =
"https://api-bakong.nbc.gov.kh"
DEFAULT_TIMEOUT =
45

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
17
18
19
# File 'lib/bakong/open_api/configuration.rb', line 14

def initialize
  @base_url = DEFAULT_BASE_URL
  @open_timeout = DEFAULT_TIMEOUT
  @read_timeout = DEFAULT_TIMEOUT
  @user_agent = "bakong-open-api-ruby/#{Bakong::OpenApi::VERSION}"
end

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



12
13
14
# File 'lib/bakong/open_api/configuration.rb', line 12

def base_url
  @base_url
end

#open_timeoutObject

Returns the value of attribute open_timeout.



12
13
14
# File 'lib/bakong/open_api/configuration.rb', line 12

def open_timeout
  @open_timeout
end

#read_timeoutObject

Returns the value of attribute read_timeout.



12
13
14
# File 'lib/bakong/open_api/configuration.rb', line 12

def read_timeout
  @read_timeout
end

#tokenObject

Returns the value of attribute token.



12
13
14
# File 'lib/bakong/open_api/configuration.rb', line 12

def token
  @token
end

#user_agentObject

Returns the value of attribute user_agent.



12
13
14
# File 'lib/bakong/open_api/configuration.rb', line 12

def user_agent
  @user_agent
end