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.



170
171
172
# File 'lib/rspec-puppet/coverage.rb', line 170

def initialize(resource = nil)
  @resource = resource
end

Instance Attribute Details

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



178
179
180
181
182
# File 'lib/rspec-puppet/coverage.rb', line 178

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

#to_sObject



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

Returns:

  • (Boolean)


188
189
190
# File 'lib/rspec-puppet/coverage.rb', line 188

def touched?
  !!@touched
end