Module: Generators::ReferencedListBuilder

Included in:
HTMLPuppetClass, HTMLPuppetNode
Defined in:
lib/puppet/util/rdoc/generators/puppet_generator.rb

Overview

This module is used to generate a referenced full name list of ContextUser

Instance Method Summary collapse

Instance Method Details

#build_referenced_list(list) ⇒ Object


355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 355

def build_referenced_list(list)
  res = []
  list.each do |i|
    ref = AllReferences[i.name] || @context.find_symbol(i.name)
    ref = ref.viewer if ref and ref.respond_to?(:viewer)
    name = i.respond_to?(:full_name) ? i.full_name : i.name
    h_name = CGI.escapeHTML(name)
    if ref and ref.document_self
      path = url(ref.path)
      res << { "name" => h_name, "aref" => path }
    else
      res << { "name" => h_name }
    end
  end
  res
end