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.



270
271
272
273
274
275
276
# File 'lib/puppet/util/rdoc/code_objects.rb', line 270

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.



268
269
270
# File 'lib/puppet/util/rdoc/code_objects.rb', line 268

def params
  @params
end

#titleObject

Returns the value of attribute title.



268
269
270
# File 'lib/puppet/util/rdoc/code_objects.rb', line 268

def title
  @title
end

#typeObject

Returns the value of attribute type.



268
269
270
# File 'lib/puppet/util/rdoc/code_objects.rb', line 268

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



278
279
280
# File 'lib/puppet/util/rdoc/code_objects.rb', line 278

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

#full_nameObject



282
283
284
# File 'lib/puppet/util/rdoc/code_objects.rb', line 282

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

#nameObject



286
287
288
# File 'lib/puppet/util/rdoc/code_objects.rb', line 286

def name
  full_name
end

#to_sObject



290
291
292
293
294
# File 'lib/puppet/util/rdoc/code_objects.rb', line 290

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