Module: Propagate

Defined in:
lib/propagate.rb,
lib/propagate/verify.rb,
lib/propagate/version.rb,
lib/propagate/client_helper.rb,
lib/propagate/configuration.rb

Defined Under Namespace

Modules: ClientHelper, Verify Classes: Configuration, PropagateError

Constant Summary collapse

PROPAGATE_API_SERVER_URL =
'http://nakeit.propagate.com.br'
PROPAGATE_API_SECURE_SERVER_URL =
'https://nakeit.propagate.com.br'
PROPAGATE_VERIFY_URL =
'http://nakeit.propagate.com.br'
HANDLE_TIMEOUTS_GRACEFULLY =
true
SKIP_VERIFY_ENV =
['test', 'cucumber']
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.configurationObject

Gives access to the current Configuration.



14
15
16
# File 'lib/propagate.rb', line 14

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Allows easy setting of multiple configuration options. See Configuration for all available options. – The temp assignment is only used to get a nicer rdoc. Feel free to remove this hack. ++

Yields:

  • (config)


24
25
26
27
# File 'lib/propagate.rb', line 24

def self.configure
  config = configuration
  yield(config)
end

.with_configuration(config) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/propagate.rb', line 29

def self.with_configuration(config)
  original_config = {}

  config.each do |key, value|
    original_config[key] = configuration.send(key)
    configuration.send("#{key}=", value)
  end

  result = yield if block_given?

  original_config.each { |key, value| configuration.send("#{key}=", value) }
  result
end