Class: Notisend::Configuration

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

Overview

Holds client settings; every option can be overridden per Client instance

Constant Summary collapse

DEFAULT_BASE_URL =
'https://api.notisend.ru/v1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
# File 'lib/notisend/configuration.rb', line 10

def initialize
  @api_token = ENV.fetch('NOTISEND_API_TOKEN', nil)
  @base_url = DEFAULT_BASE_URL
  @open_timeout = 10
  @timeout = 30
  @verify_ssl = ENV.fetch('NOTISEND_VERIFY_SSL', 'true') != 'false'
  @ca_bundle_file = ENV.fetch('NOTISEND_CA_BUNDLE_FILE', nil)
  @logger = nil
end

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token.



8
9
10
# File 'lib/notisend/configuration.rb', line 8

def api_token
  @api_token
end

#base_urlObject

Returns the value of attribute base_url.



8
9
10
# File 'lib/notisend/configuration.rb', line 8

def base_url
  @base_url
end

#ca_bundle_fileObject

Returns the value of attribute ca_bundle_file.



8
9
10
# File 'lib/notisend/configuration.rb', line 8

def ca_bundle_file
  @ca_bundle_file
end

#loggerObject

Returns the value of attribute logger.



8
9
10
# File 'lib/notisend/configuration.rb', line 8

def logger
  @logger
end

#open_timeoutObject

Returns the value of attribute open_timeout.



8
9
10
# File 'lib/notisend/configuration.rb', line 8

def open_timeout
  @open_timeout
end

#timeoutObject

Returns the value of attribute timeout.



8
9
10
# File 'lib/notisend/configuration.rb', line 8

def timeout
  @timeout
end

#verify_sslObject

Returns the value of attribute verify_ssl.



8
9
10
# File 'lib/notisend/configuration.rb', line 8

def verify_ssl
  @verify_ssl
end