class T::Types::ClassOf
Validates that an object belongs to the specified class.
def describe_obj(obj)
def describe_obj(obj) obj.inspect end
def initialize(type)
def initialize(type) @type = type end
def name
def name "T.class_of(#{@type})" end
def subtype_of_single?(other)
def subtype_of_single?(other) case other when ClassOf @type <= other.type else false end end
def valid?(obj)
def valid?(obj) obj.is_a?(Module) && obj <= @type end