module Gruf::Rspec::Configuration

Represents configuration settings for the system

Constants

VALID_CONFIG_KEYS

Public Class Methods

extended(base) click to toggle source

Whenever this is extended into a class, setup the defaults

# File lib/gruf/rspec/configuration.rb, line 38
def self.extended(base)
  base.reset
end

Public Instance Methods

configure() { |self| ... } click to toggle source

Yield self for ruby-style initialization

@yields [Gruf::Rspec::Configuration] The configuration object for gruf @return [Gruf::Rspec::Configuration] The configuration object for gruf

# File lib/gruf/rspec/configuration.rb, line 48
def configure
  yield self
end
options() click to toggle source

Return the current configuration options as a Hash

@return [Hash] The configuration for gruf, represented as a Hash

# File lib/gruf/rspec/configuration.rb, line 57
def options
  opts = {}
  VALID_CONFIG_KEYS.each_key do |k|
    opts.merge!(k => send(k))
  end
  opts
end
reset() click to toggle source

Set the default configuration onto the extended class

@return [Hash] options The reset options hash

# File lib/gruf/rspec/configuration.rb, line 70
def reset
  VALID_CONFIG_KEYS.each do |k, v|
    send((k.to_s + '='), v)
  end
  self.rpc_spec_path = '/spec/rpc/'.freeze
  options
end