class T::Types::ClassOf

Validates that an object belongs to the specified class.

def describe_obj(obj)

overrides Base
def describe_obj(obj)
  obj.inspect
end

def initialize(type)

def initialize(type)
  @type = type
end

def name

overrides Base
def name
  "T.class_of(#{@type})"
end

def subtype_of_single?(other)

overrides Base
def subtype_of_single?(other)
  case other
  when ClassOf
    @type <= other.type
  else
    false
  end
end

def valid?(obj)

overrides Base
def valid?(obj)
  obj.is_a?(Module) && obj <= @type
end