Sha256: a9e491cf2892ad71e1a99b6e610f465aa758edeb6d2dcb0447f1f0e707dc47d6

Contents?: true

Size: 726 Bytes

Versions: 24

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true
# ProxyRb
module ProxyRb
  # Basic Configuration
  class BasicConfiguration
    # A configuration option
    #
    # @private
    class Option
      attr_accessor :name, :value
      attr_reader :default_value

      # Create option
      def initialize(opts = {})
        name = opts[:name]
        value = opts[:value]

        raise ArgumentError, '"name" is required' unless opts.key? :name
        raise ArgumentError, '"value" is required' unless opts.key? :value

        @name          = name
        @value         = value
        @default_value = value
      end

      # Compare option
      def ==(other)
        name == other.name && value == other.value
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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