Sha256: c9354d864064c77a3def0bd57aff71691bf41686a43d56a9c2399766b36b97fe

Contents?: true

Size: 729 Bytes

Versions: 19

Compression:

Stored size: 729 Bytes

Contents

# frozen_string_literal: true
# ProxyRb
module ProxyRb
  # Basic Configuration
  class BasicConfiguration
    # In config wrapper
    #
    # Used to make the configuration read only if one needs to access an
    # configuration option from with `ProxyRb::Config`.
    #
    # @private
    class InConfigurationWrapper
      attr_reader :config
      private :config

      def initialize(config)
        @config = config.dup
      end

      def method_missing(name, *args)
        raise ArgumentError, 'Options take no argument' if args.count > 0
        raise UnknownOptionError, %(Option "#{name}" is unknown. Please use only earlier defined options) unless config.key? name

        config[name]
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
proxy_rb-0.10.6 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.10.5 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.10.4 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.10.3 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.10.2 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.10.1 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.10.0 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.9.3 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.9.2 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.9.1 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.9.0 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.8.3 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.8.2 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.8.1 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.8.0 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.7.1 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.7.0 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.6.0 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb
proxy_rb-0.5.0 lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb