module Gruf::Balancer::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/balancer/configuration.rb, line 31 def self.extended(base) base.reset end
Public Instance Methods
configure() { |self| ... }
click to toggle source
Yield self for ruby-style initialization
@yields [Gruf::Balancer::Configuration] The configuration object @return [Gruf::Balancer::Configuration] The configuration object
# File lib/gruf/balancer/configuration.rb, line 41 def configure yield self end
options()
click to toggle source
Return the current configuration options as a Hash
@return [Hash] The configuration represented as a Hash
# File lib/gruf/balancer/configuration.rb, line 50 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/balancer/configuration.rb, line 63 def reset VALID_CONFIG_KEYS.each do |k, v| send("#{k}=", v) end options end