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_json(opts) ⇒ Object
- #to_s ⇒ Object
- #touch! ⇒ Object
- #touched? ⇒ Boolean
Constructor Details
#initialize(resource = nil) ⇒ ResourceWrapper
Returns a new instance of ResourceWrapper.
334 335 336 |
# File 'lib/rspec-puppet/coverage.rb', line 334 def initialize(resource = nil) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
332 333 334 |
# File 'lib/rspec-puppet/coverage.rb', line 332 def resource @resource end |
Instance Method Details
#to_hash ⇒ Object
342 343 344 345 346 |
# File 'lib/rspec-puppet/coverage.rb', line 342 def to_hash { touched: touched? } end |
#to_json(opts) ⇒ Object
348 349 350 |
# File 'lib/rspec-puppet/coverage.rb', line 348 def to_json(opts) to_hash.to_json(opts) end |
#to_s ⇒ Object
338 339 340 |
# File 'lib/rspec-puppet/coverage.rb', line 338 def to_s @resource.to_s end |
#touch! ⇒ Object
352 353 354 |
# File 'lib/rspec-puppet/coverage.rb', line 352 def touch! @touched = true end |
#touched? ⇒ Boolean
356 357 358 |
# File 'lib/rspec-puppet/coverage.rb', line 356 def touched? !!@touched end |