Sha256: a61755e906deab613976824ea25fde999c09950a189ba7193933d5478080066b
Contents?: true
Size: 626 Bytes
Versions: 12
Compression:
Stored size: 626 Bytes
Contents
# frozen_string_literal: true module Grape # Registry to store and locate known Validators. module Validations class << self attr_accessor :validators end self.validators = {} # Register a new validator, so it can be used to validate parameters. # @param short_name [String] all lower-case, no spaces # @param klass [Class] the validator class. Should inherit from # Validations::Base. def self.register_validator(short_name, klass) validators[short_name] = klass end def self.deregister_validator(short_name) validators.delete(short_name) end end end
Version data entries
12 entries across 12 versions & 2 rubygems