Sha256: e8b72c6e9f38baf75e67d2f61e8553642ceb2a64c694db407df73d2ebf76b295
Contents?: true
Size: 720 Bytes
Versions: 20
Compression:
Stored size: 720 Bytes
Contents
# encoding: utf-8 module Nimbu module Request module Validations module Required # Validate all keys present in a provided hash against required set, # on mismatch raise Nimbu::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 Nimbu::Error::RequiredParams.new(provided, required) end result end end # Required end # Validations end # Request end # Nimbu
Version data entries
20 entries across 20 versions & 1 rubygems