lib/yard/code_objects/class_object.rb in yard-0.5.3 vs lib/yard/code_objects/class_object.rb in yard-0.5.4

- old
+ new

@@ -9,19 +9,19 @@ # @see Base.new def initialize(namespace, name, *args, &block) super if is_exception? - self.superclass ||= :Exception unless P(namespace, name) == P(:Exception) + self.superclass ||= "::Exception" unless P(namespace, name) == P(:Exception) else case P(namespace, name).path when "BasicObject" nil when "Object" - self.superclass ||= :BasicObject + self.superclass ||= "::BasicObject" else - self.superclass ||= :Object + self.superclass ||= "::Object" end end end # Whether or not the class is a Ruby Exception @@ -36,11 +36,11 @@ # @param [Boolean] include_mods whether or not to include mixins in the # inheritance tree. # @return [Array<NamespaceObject>] the list of code objects that make up # the inheritance tree. def inheritance_tree(include_mods = false) - list = (include_mods ? mixins(:instance) : []) + list = (include_mods ? mixins(:instance, :class) : []) if superclass.is_a?(Proxy) || superclass.respond_to?(:inheritance_tree) list += [superclass] unless superclass == P(:Object) || superclass == P(:BasicObject) end [self] + list.map do |m| next m unless m.respond_to?(:inheritance_tree) @@ -124,10 +124,10 @@ @superclass = Proxy.new(namespace.namespace, object) end if @superclass == self msg = "superclass #{@superclass.inspect} cannot be the same as the declared class #{self.inspect}" - @superclass = P(:Object) + @superclass = P("::Object") raise ArgumentError, msg end end end end