lib/kind/basic.rb in kind-5.2.0 vs lib/kind/basic.rb in kind-5.3.0
- old
+ new
@@ -33,32 +33,38 @@
def of?(kind, *args)
KIND.of?(kind, args)
end
def of_class?(value)
- KIND.of_class?(value)
+ OF.class?(value)
end
def of_module?(value)
- KIND.of_module?(value)
+ OF.module?(value)
end
def respond_to?(value, *method_names)
return super(value) if method_names.empty?
KIND.interface?(method_names, value)
end
def of(kind, value, label: nil)
- return value if kind === value
-
- KIND.error!(kind.name, value, label)
+ STRICT.object_is_a(kind, value, label)
end
alias_method :of!, :of
+ def of_class(value)
+ STRICT.class!(value)
+ end
+
+ def of_module(value)
+ STRICT.module!(value)
+ end
+
def of_module_or_class(value)
- KIND.of_module_or_class!(value)
+ STRICT.module_or_class(value)
end
def respond_to(value, *method_names)
method_names.each { |method_name| KIND.respond_to!(method_name, value) }