Sha256: fe7ea77237a3e55bc5cf7ae02c2b16e6d49e7c06a6a2589bc68564e95332ad32
Contents?: true
Size: 944 Bytes
Versions: 196
Compression:
Stored size: 944 Bytes
Contents
class Apipie::Validator::TypeValidator def description @type.name end end class Apipie::Validator::HashValidator def description "Hash" end end module Katello module Apipie module Validators class IdentifierValidator < ::Apipie::Validator::BaseValidator def validate(value) value = value.to_s value =~ /\A[\w| |_|-]*\Z/ && value.strip == value && (2..128).include?(value.length) end def self.build(param_description, argument, _options, _block) if argument == :identifier self.new(param_description) end end def error "Parameter #{param_name} expecting to be an identifier, got: #{@error_value}" end def description "string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space.." end end end end end
Version data entries
196 entries across 196 versions & 1 rubygems