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.
149 150 151 |
# File 'lib/rspec-puppet/coverage.rb', line 149 def initialize(resource = nil) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
147 148 149 |
# File 'lib/rspec-puppet/coverage.rb', line 147 def resource @resource end |
Instance Method Details
#to_hash ⇒ Object
157 158 159 160 161 |
# File 'lib/rspec-puppet/coverage.rb', line 157 def to_hash { 'touched' => touched?, } end |
#to_s ⇒ Object
153 154 155 |
# File 'lib/rspec-puppet/coverage.rb', line 153 def to_s @resource.to_s end |
#touch! ⇒ Object
163 164 165 |
# File 'lib/rspec-puppet/coverage.rb', line 163 def touch! @touched = true end |
#touched? ⇒ Boolean
167 168 169 |
# File 'lib/rspec-puppet/coverage.rb', line 167 def touched? !!@touched end |