lib/yard/code_objects/class_object.rb in yard-0.9.5 vs lib/yard/code_objects/class_object.rb in yard-0.9.6
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
module YARD::CodeObjects
register_separator NSEP, :class
# A ClassObject represents a Ruby class in source code. It is a {ModuleObject}
# with extra inheritance semantics through the superclass.
@@ -30,11 +31,11 @@
# Whether or not the class is a Ruby Exception
#
# @return [Boolean] whether the object represents a Ruby exception
def is_exception?
- inheritance_tree.reverse.any? {|o| BUILTIN_EXCEPTIONS_HASH.has_key? o.path }
+ inheritance_tree.reverse.any? {|o| BUILTIN_EXCEPTIONS_HASH.key? o.path }
end
# Returns the inheritance tree of the object including self.
#
# @param [Boolean] include_mods whether or not to include mixins in the
@@ -134,10 +135,10 @@
if name == @superclass.name && namespace != YARD::Registry.root && !object.is_a?(Base)
@superclass = Proxy.new(namespace.namespace, object)
end
if @superclass == self
- msg = "superclass #{@superclass.inspect} cannot be the same as the declared class #{self.inspect}"
+ msg = "superclass #{@superclass.inspect} cannot be the same as the declared class #{inspect}"
@superclass = P("::Object")
raise ArgumentError, msg
end
end
end