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.
170 171 172 |
# File 'lib/rspec-puppet/coverage.rb', line 170 def initialize(resource = nil) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
168 169 170 |
# File 'lib/rspec-puppet/coverage.rb', line 168 def resource @resource end |
Instance Method Details
#to_hash ⇒ Object
178 179 180 181 182 |
# File 'lib/rspec-puppet/coverage.rb', line 178 def to_hash { :touched => touched?, } end |
#to_s ⇒ Object
174 175 176 |
# File 'lib/rspec-puppet/coverage.rb', line 174 def to_s @resource.to_s end |
#touch! ⇒ Object
184 185 186 |
# File 'lib/rspec-puppet/coverage.rb', line 184 def touch! @touched = true end |
#touched? ⇒ Boolean
188 189 190 |
# File 'lib/rspec-puppet/coverage.rb', line 188 def touched? !!@touched end |