Sha256: ea88863723753796b76074156aa0ac1e5beef6b4af1b293e937b048c7a053263

Contents?: true

Size: 283 Bytes

Versions: 2

Compression:

Stored size: 283 Bytes

Contents

module ObjectValidator
  module Checks
    class Keys < Base
      def call
        return if method.is_a?(Hash) &&
                  value.each { |key| break false unless method.key?(key) }
        errors.add(name, 'does not contain required Hash keys')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
object_validator-0.1.1 lib/object_validator/checks/keys.rb
object_validator-0.1.0 lib/object_validator/checks/keys.rb