Class: RDoc::Plugin

Inherits:
Context show all
Defined in:
lib/puppet/util/rdoc/code_objects.rb

Overview

Plugin holds a native puppet plugin (function,type…) It is mapped to a HTMLPuppetPlugin for display

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type) ⇒ Plugin

Returns a new instance of Plugin.



240
241
242
243
244
245
# File 'lib/puppet/util/rdoc/code_objects.rb', line 240

def initialize(name, type)
  super()
  @name = name
  @type = type
  @comment = ""
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



238
239
240
# File 'lib/puppet/util/rdoc/code_objects.rb', line 238

def name
  @name
end

#typeObject

Returns the value of attribute type.



238
239
240
# File 'lib/puppet/util/rdoc/code_objects.rb', line 238

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



247
248
249
# File 'lib/puppet/util/rdoc/code_objects.rb', line 247

def <=>(other)
  @name <=> other.name
end

#full_nameObject



251
252
253
# File 'lib/puppet/util/rdoc/code_objects.rb', line 251

def full_name
  @name
end

#http_url(prefix) ⇒ Object



255
256
257
258
# File 'lib/puppet/util/rdoc/code_objects.rb', line 255

def http_url(prefix)
  path = full_name.split("::")
  File.join(prefix, *path) + ".html"
end

#is_fact?Boolean

Returns:

  • (Boolean)


260
261
262
# File 'lib/puppet/util/rdoc/code_objects.rb', line 260

def is_fact?
  false
end

#to_sObject



264
265
266
267
268
# File 'lib/puppet/util/rdoc/code_objects.rb', line 264

def to_s
  res = self.class.name + ": #{@name} (#{@type})\n"
  res << @comment.to_s
  res
end