class RailsParamValidation::AnnotationTypes::CustomT
def self.register(type, schema)
def self.register(type, schema) registry[type] = schema end
def self.registered(type)
def self.registered(type) raise TypeNotFound.new(type) unless registry.key? type registry[type].is_a?(Proc) ? registry[type].call : registry[type] end
def self.registry
def self.registry @@types ||= {} end
def self.types
def self.types registry.keys end
def initialize(type, from: :name)
def initialize(type, from: :name) @type = type @from = from end
def schema
def schema schema = CustomT.registry[@type] schema = CustomT.registry[@type] = schema.call if schema.is_a?(Proc) schema end