module RSpecApib

Constants

ROOT_THREAD_VARS
VERSION

Public Class Methods

config() { |config| ... } click to toggle source

The global configuration object If a block is passed into this method, it is yielded with the config object and all actions are performed from within the block as a batch - any action(s) that then need performing after a reconfigure are done once only.

# File lib/rspec_apib.rb, line 16
def self.config
  return config_instance unless block_given?
  config_instance.batch_configure do |config|
    yield(config)
  end
end
config_instance() click to toggle source
# File lib/rspec_apib.rb, line 37
def self.config_instance
  root_thread_vars[:config_instance] ||= RSpecApib::Config.new
end
normalize_request(request) click to toggle source
# File lib/rspec_apib.rb, line 23
def self.normalize_request(request)
  Request.new request
end
normalize_response(response) click to toggle source
# File lib/rspec_apib.rb, line 27
def self.normalize_response(response)
  Response.new response
end
root_thread_vars() click to toggle source

Global storage per thread for the gems to use where required. @return [Hash] A hash which the caller is free to modify at will

# File lib/rspec_apib.rb, line 33
def self.root_thread_vars
  Thread.current[ROOT_THREAD_VARS] ||= {}
end