Class: RSpec::Puppet::Coverage::ResourceWrapper
- Inherits:
-
Object
- Object
- RSpec::Puppet::Coverage::ResourceWrapper
- Defined in:
- lib/rspec-puppet/coverage.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource = nil) ⇒ ResourceWrapper
constructor
A new instance of ResourceWrapper.
- #to_hash ⇒ Object
- #to_s ⇒ Object
- #touch! ⇒ Object
- #touched? ⇒ Boolean
Constructor Details
#initialize(resource = nil) ⇒ ResourceWrapper
Returns a new instance of ResourceWrapper.
195 196 197 |
# File 'lib/rspec-puppet/coverage.rb', line 195 def initialize(resource = nil) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
193 194 195 |
# File 'lib/rspec-puppet/coverage.rb', line 193 def resource @resource end |
Instance Method Details
#to_hash ⇒ Object
203 204 205 206 207 |
# File 'lib/rspec-puppet/coverage.rb', line 203 def to_hash { :touched => touched?, } end |
#to_s ⇒ Object
199 200 201 |
# File 'lib/rspec-puppet/coverage.rb', line 199 def to_s @resource.to_s end |
#touch! ⇒ Object
209 210 211 |
# File 'lib/rspec-puppet/coverage.rb', line 209 def touch! @touched = true end |
#touched? ⇒ Boolean
213 214 215 |
# File 'lib/rspec-puppet/coverage.rb', line 213 def touched? !!@touched end |