Class: RSpec::Puppet::Coverage::ResourceWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-puppet/coverage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#resourceObject (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_hashObject



91
92
93
94
95
# File 'lib/rspec-puppet/coverage.rb', line 91

def to_hash
  {
    'touched' => touched?,
  }
end

#to_sObject



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

Returns:

  • (Boolean)


101
102
103
# File 'lib/rspec-puppet/coverage.rb', line 101

def touched?
  !!@touched
end