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.



197
198
199
# File 'lib/rspec-puppet/coverage.rb', line 197

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

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



195
196
197
# File 'lib/rspec-puppet/coverage.rb', line 195

def resource
  @resource
end

Instance Method Details

#to_hashObject



205
206
207
208
209
# File 'lib/rspec-puppet/coverage.rb', line 205

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

#to_sObject



201
202
203
# File 'lib/rspec-puppet/coverage.rb', line 201

def to_s
  @resource.to_s
end

#touch!Object



211
212
213
# File 'lib/rspec-puppet/coverage.rb', line 211

def touch!
  @touched = true
end

#touched?Boolean

Returns:

  • (Boolean)


215
216
217
# File 'lib/rspec-puppet/coverage.rb', line 215

def touched?
  !!@touched
end