Class: PuppetX::PuppetLabs::Strings::YARD::CodeObjects::HostClassObject

Inherits:
DefinedTypeObject show all
Defined in:
lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb

Instance Attribute Summary collapse

Attributes inherited from DefinedTypeObject

#parameters, #type_info

Attributes inherited from PuppetNamespaceObject

#type_info

Instance Method Summary collapse

Methods inherited from DefinedTypeObject

#to_json, #to_s

Methods inherited from PuppetNamespaceObject

#to_json, #to_s

Instance Attribute Details

#parent_classHostClassObject, ...

The PuppetX::PuppetLabs::Strings::YARD::CodeObjects::HostClassObject that this class inherits from, if any.



4
5
6
# File 'lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb', line 4

def parent_class
  @parent_class
end

Instance Method Details

#inheritance_tree(include_mods = false) ⇒ Object

NOTE: ‘include_mods` is never used as it makes no sense for Puppet, but this is called by `YARD::Registry` and it will pass a parameter.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb', line 8

def inheritance_tree(include_mods = false)
  if parent_class.is_a?(PuppetX::PuppetLabs::Strings::YARD::CodeObjects::HostClassObject)
    # Cool. We got a host class. Return self + parent inheritance tree.
    [self] + parent_class.inheritance_tree
  elsif parent_class.is_a?(YARD::CodeObjects::Proxy)
    # We have a reference to a parent that has not been created yet. Just
    # return it.
    [self, parent_class]
  else
    # Most likely no parent class. But also possibly an object that we
    # shouldn't inherit from. Just return self.
    [self]
  end
end