lib/bandwidth/configuration.rb in bandwidth-sdk-3.0.0 vs lib/bandwidth/configuration.rb in bandwidth-sdk-3.1.0
- old
+ new
@@ -57,11 +57,11 @@
# The amount to multiply each successive retry's interval amount
# by in order to provide backoff
@backoff_factor = backoff_factor
# Current API environment
- @environment = environment
+ @environment = String(environment)
# The username to use with basic authentication
@messaging_basic_auth_user_name = messaging_basic_auth_user_name
# The password to use with basic authentication
@@ -109,22 +109,22 @@
retry_interval: retry_interval,
backoff_factor: backoff_factor)
end
# All the environments the SDK can run in.
- @environments = {
+ ENVIRONMENTS = {
Environment::PRODUCTION => {
Server::DEFAULT => 'api.bandwidth.com',
Server::MESSAGINGDEFAULT => 'https://messaging.bandwidth.com/api/v2',
Server::VOICEDEFAULT => 'https://voice.bandwidth.com'
}
- }
+ }.freeze
# Generates the appropriate base URI for the environment and the server.
# @param [Configuration::Server] The server enum for which the base URI is
# required.
# @return [String] The base URI.
def get_base_uri(server = Server::DEFAULT)
- self.class.environments[environment][server].clone
+ ENVIRONMENTS[environment][server].clone
end
end
end