puppet-strings/lib/puppetx/yardoc/yard/templates/default/hostclass/setup.rb

21 lines
520 B
Ruby

include T('default/definedtype')
def init
super
sections.push :subclasses
end
def subclasses
# The naming is a bit weird because Ruby classes use `globals.subclasses`.
unless globals.hostsubclasses
globals.hostsubclasses = {}
list = run_verifier Registry.all(:hostclass)
list.each {|o| (globals.hostsubclasses[o.parent_class.path] ||= []) << o if o.parent_class }
end
@subclasses = globals.hostsubclasses[object.path]
return if @subclasses.nil? || @subclasses.empty?
erb(:subclasses)
end