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.
83 84 85 |
# File 'lib/rspec-puppet/coverage.rb', line 83 def initialize(resource = nil) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
81 82 83 |
# File 'lib/rspec-puppet/coverage.rb', line 81 def resource @resource end |
Instance Method Details
#to_hash ⇒ Object
91 92 93 94 95 |
# File 'lib/rspec-puppet/coverage.rb', line 91 def to_hash { 'touched' => touched?, } end |
#to_s ⇒ Object
87 88 89 |
# File 'lib/rspec-puppet/coverage.rb', line 87 def to_s @resource.to_s end |
#touch! ⇒ Object
97 98 99 |
# File 'lib/rspec-puppet/coverage.rb', line 97 def touch! @touched = true end |
#touched? ⇒ Boolean
101 102 103 |
# File 'lib/rspec-puppet/coverage.rb', line 101 def touched? !!@touched end |