Class: RDoc::PuppetResource

Inherits:
CodeObject
  • Object
show all
Defined in:
lib/puppet/util/rdoc/code_objects.rb

Overview

PuppetResource holds a puppet resource It is mapped to a HTMLPuppetResource for display A resource is defined by its “normal” form Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, title, comment, params) ⇒ PuppetResource

Returns a new instance of PuppetResource.



308
309
310
311
312
313
314
# File 'lib/puppet/util/rdoc/code_objects.rb', line 308

def initialize(type, title, comment, params)
  super()
  @type = type
  @title = title
  @comment = comment
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



306
307
308
# File 'lib/puppet/util/rdoc/code_objects.rb', line 306

def params
  @params
end

#titleObject

Returns the value of attribute title.



306
307
308
# File 'lib/puppet/util/rdoc/code_objects.rb', line 306

def title
  @title
end

#typeObject

Returns the value of attribute type.



306
307
308
# File 'lib/puppet/util/rdoc/code_objects.rb', line 306

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



316
317
318
# File 'lib/puppet/util/rdoc/code_objects.rb', line 316

def <=>(other)
  full_name <=> other.full_name
end

#full_nameObject



320
321
322
# File 'lib/puppet/util/rdoc/code_objects.rb', line 320

def full_name
  @type + "[#{@title}]"
end

#nameObject



324
325
326
# File 'lib/puppet/util/rdoc/code_objects.rb', line 324

def name
  full_name
end

#to_sObject



328
329
330
331
332
# File 'lib/puppet/util/rdoc/code_objects.rb', line 328

def to_s
  res = @type + "[#{@title}]\n"
  res << @comment.to_s
  res
end