class Seahorse::Client::Configuration::DefaultResolver
@api private
def initialize(struct)
def initialize(struct) @struct = struct @members = Set.new(@struct.members) end
def method_missing(method_name, *args)
def method_missing(method_name, *args) if @members.include?(method_name) value_at(method_name) else super end end
def override_config(k, v)
def override_config(k, v) @struct[k] = v end
def resolve
def resolve @members.each { |opt_name| value_at(opt_name) } end
def resolve_defaults(opt_name, defaults)
def resolve_defaults(opt_name, defaults) defaults.each do |default| default = default.call(self) if default.is_a?(DynamicDefault) @struct[opt_name] = default break if !default.nil? end @struct[opt_name] end
def respond_to?(method_name, *args)
def respond_to?(method_name, *args) @members.include?(method_name) or super end
def value_at(opt_name)
def value_at(opt_name) value = @struct[opt_name] if value.is_a?(Defaults) resolve_defaults(opt_name, value) else value end end