From a71c53f3d5ed223190f47480a11dfc42ada560b8 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Sun, 1 Jun 2014 18:01:32 -0700 Subject: [PATCH] Add DefinedTypeObject#inheritance_tree The `YARD::Registry#resolve` method assumes all subclasses of `NamespaceObject` respond to `inheritance_tree`. Ref commit d6a4791 for a similar case with `HostClassObject`. --- lib/puppetx/yardoc/yard/code_objects/defined_type_object.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/puppetx/yardoc/yard/code_objects/defined_type_object.rb b/lib/puppetx/yardoc/yard/code_objects/defined_type_object.rb index 00d2a7f..8be8817 100644 --- a/lib/puppetx/yardoc/yard/code_objects/defined_type_object.rb +++ b/lib/puppetx/yardoc/yard/code_objects/defined_type_object.rb @@ -9,6 +9,12 @@ module Puppetx::Yardoc::YARD::CodeObjects # @return [Array] attr_accessor :parameters + # NOTE: `YARD::Registry#resolve` requires a method with this signature to + # be present on all subclasses of `NamespaceObject`. + def inheritance_tree(include_mods = false) + [self] + end + # FIXME: We used to override `self.new` to ensure no YARD proxies were # created for namespaces segments that did not map to a host class or # defined type. Fighting the system in this way turned out to be