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.



149
150
151
# File 'lib/rspec-puppet/coverage.rb', line 149

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

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



147
148
149
# File 'lib/rspec-puppet/coverage.rb', line 147

def resource
  @resource
end

Instance Method Details

#to_hashObject



157
158
159
160
161
# File 'lib/rspec-puppet/coverage.rb', line 157

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

#to_sObject



153
154
155
# File 'lib/rspec-puppet/coverage.rb', line 153

def to_s
  @resource.to_s
end

#touch!Object



163
164
165
# File 'lib/rspec-puppet/coverage.rb', line 163

def touch!
  @touched = true
end

#touched?Boolean

Returns:

  • (Boolean)


167
168
169
# File 'lib/rspec-puppet/coverage.rb', line 167

def touched?
  !!@touched
end