Sha256: 2a06fa6ddf3263229e16f13277c23a390f3e3d2e0b0c79abd6176e736b0478af

Contents?: true

Size: 502 Bytes

Versions: 197

Compression:

Stored size: 502 Bytes

Contents

module WebMock
  class HashValidator
    def initialize(hash)
      @hash = hash
    end

    #This code is based on https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/hash/keys.rb
    def validate_keys(*valid_keys)
      valid_keys.flatten!
      @hash.each_key do |k|
        unless valid_keys.include?(k)
          raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}")
        end
      end
    end
  end
end

Version data entries

197 entries across 186 versions & 13 rubygems

Version Path
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
cloudsmith-api-1.142.3 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/util/hash_validator.rb
webmock-3.18.1 lib/webmock/util/hash_validator.rb