Method: RDoc::PuppetModule#add_plugin

Defined in:
lib/puppet/util/rdoc/code_objects.rb

#add_plugin(plugin) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/puppet/util/rdoc/code_objects.rb', line 40

def add_plugin(plugin)
  name = plugin.name
  type = plugin.type
  meth = AnyMethod.new("*args", name)
  meth.params = "(*args)"
  meth.visibility = :public
  meth.document_self = true
  meth.singleton = false
  meth.comment = plugin.comment
  case type
  when 'function'
    @function_container ||= add_module(NormalModule, "__functions__")
    @function_container.add_method(meth)
  when 'type'
    @type_container ||= add_module(NormalModule, "__types__")
    @type_container.add_method(meth)
  end
end