class Central::Devtools::Config::TypeCheck
Simple named type check representation
Constants
- CLASS_DELIM
- FORMAT_ERROR
Public Instance Methods
call(value)
click to toggle source
Check value for instance of expected class
@param [Object] value @return [Object]
# File lib/central/devtools/config.rb, line 24 def call(value) klass = value.class unless allowed_classes.any?(&klass.method(:equal?)) fail TypeError, FORMAT_ERROR % { name: name, got: klass, allowed: allowed_classes.join(CLASS_DELIM) } end value end