Class: Propagate::Configuration

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

Overview

This class enables detailed configuration of the propagate services.

By calling

Propagate.configuration # => instance of Propagate::Configuration

or

Propagate.configure do |config|
  config # => instance of Propagate::Configuration
end

you are able to perform configuration updates.

Your are able to customize all attributes listed below. All values have sensitive default and will very likely not need to be changed.

Please note that the public and private key for the Propagate API Access have no useful default value. The keys may be set via the Shell enviroment or using this configuration. Settings within this configuration always take precedence.

Setting the keys with this Configuration

Propagate.configure do |config|
  config.public_key  = '6Lc6BAAAAAAAAChqRbQZcn_yyyyyyyyyyyyyyyyy'
  config.private_key = '6Lc6BAAAAAAAAKN3DRm6VA_xxxxxxxxxxxxxxxxx'
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

:nodoc:



40
41
42
43
44
45
46
47
48
49
# File 'lib/propagate/configuration.rb', line 40

def initialize #:nodoc:
  @nonssl_api_server_url      = PROPAGATE_API_SERVER_URL
  @ssl_api_server_url         = PROPAGATE_API_SECURE_SERVER_URL
  @verify_url                 = PROPAGATE_VERIFY_URL
  @skip_verify_env            = SKIP_VERIFY_ENV
  @handle_timeouts_gracefully = HANDLE_TIMEOUTS_GRACEFULLY

  @private_key           = ENV['PROPAGATE_PRIVATE_KEY']
  @public_key            = ENV['PROPAGATE_PUBLIC_KEY']
end

Instance Attribute Details

#handle_timeouts_gracefullyObject

Returns the value of attribute handle_timeouts_gracefully.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def handle_timeouts_gracefully
  @handle_timeouts_gracefully
end

#nonssl_api_server_urlObject

Returns the value of attribute nonssl_api_server_url.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def nonssl_api_server_url
  @nonssl_api_server_url
end

#private_keyObject

Returns the value of attribute private_key.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def private_key
  @private_key
end

#proxyObject

Returns the value of attribute proxy.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def proxy
  @proxy
end

#public_keyObject

Returns the value of attribute public_key.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def public_key
  @public_key
end

#skip_verify_envObject

Returns the value of attribute skip_verify_env.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def skip_verify_env
  @skip_verify_env
end

#ssl_api_server_urlObject

Returns the value of attribute ssl_api_server_url.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def ssl_api_server_url
  @ssl_api_server_url
end

#verify_urlObject

Returns the value of attribute verify_url.



31
32
33
# File 'lib/propagate/configuration.rb', line 31

def verify_url
  @verify_url
end

Instance Method Details

#api_server_url(ssl = false) ⇒ Object

:nodoc:



51
52
53
# File 'lib/propagate/configuration.rb', line 51

def api_server_url(ssl = false) #:nodoc:
  ssl ? ssl_api_server_url : nonssl_api_server_url
end