Sha256: 3a1c4e1f21e23ccf24e2845c0e92fbc7c973c7dc6afa598716b83e822d308f0d
Contents?: true
Size: 667 Bytes
Versions: 12
Compression:
Stored size: 667 Bytes
Contents
# encoding: utf-8 module BitBucket module Validations module Required # Validate all keys present in a provided hash against required set, # on mismatch raise BitBucket::Error::RequiredParams # Note that keys need to be in the same format i.e. symbols or strings, # otherwise the comparison will fail. # def assert_required_keys(required, provided) result = required.all? do |key| provided.has_deep_key? key end if !result raise BitBucket::Error::RequiredParams.new(provided, required) end result end end # Required end # Validations end # BitBucket
Version data entries
12 entries across 12 versions & 3 rubygems