Class: PuppetUnitTests::ResourceSpec
- Inherits:
-
Object
- Object
- PuppetUnitTests::ResourceSpec
- Defined in:
- lib/puppet_unit_tests/resource_spec.rb
Overview
A resource that could maybe be found in a Puppet catalog.
Instance Attribute Summary collapse
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type, title) ⇒ ResourceSpec
constructor
A new instance of ResourceSpec.
Constructor Details
#initialize(type, title) ⇒ ResourceSpec
Returns a new instance of ResourceSpec.
10 11 12 13 14 |
# File 'lib/puppet_unit_tests/resource_spec.rb', line 10 def initialize(type, title) @type = type @title = title @parameters = {} end |
Instance Attribute Details
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
8 9 10 |
# File 'lib/puppet_unit_tests/resource_spec.rb', line 8 def parameters @parameters end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
7 8 9 |
# File 'lib/puppet_unit_tests/resource_spec.rb', line 7 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/puppet_unit_tests/resource_spec.rb', line 6 def type @type end |
Class Method Details
.parse(res_data) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/puppet_unit_tests/resource_spec.rb', line 17 def parse(res_data) rs = new(res_data["type"], res_data["title"]) return rs unless res_data["parameters"] res_data["parameters"].each do |k, v| rs.parameters[k] = v end rs end |