Sha256: 2d8649f0bf3b7b004be6095e24b22b50965ed896a0ea9a0d3b3c1a40c3dd48e0
Contents?: true
Size: 756 Bytes
Versions: 1
Compression:
Stored size: 756 Bytes
Contents
# frozen_string_literal: true module BitBucket module Validations module Format # Ensures that value for a given key is of the correct form whether # matching regular expression or set of predefined values. # def assert_valid_values(permitted, params) params.each do |k, v| next unless permitted.keys.include?(k) if permitted[k].is_a?(Array) && !permitted[k].include?(params[k]) raise BitBucket::Error::UnknownValue.new(k, v, permitted[k].join(', ')) elsif permitted[k].is_a?(Regexp) && permitted[k] !~ params[k] raise BitBucket::Error::UnknownValue.new(k, v, permitted[k]) end end end end # Format end # Validations end # BitBucket
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bitbuckets-0.2.0 | lib/bitbucket_rest_api/validations/format.rb |