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.



119
120
121
# File 'lib/rspec-puppet/coverage.rb', line 119

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

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



117
118
119
# File 'lib/rspec-puppet/coverage.rb', line 117

def resource
  @resource
end

Instance Method Details

#to_hashObject



127
128
129
130
131
# File 'lib/rspec-puppet/coverage.rb', line 127

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

#to_sObject



123
124
125
# File 'lib/rspec-puppet/coverage.rb', line 123

def to_s
  @resource.to_s
end

#touch!Object



133
134
135
# File 'lib/rspec-puppet/coverage.rb', line 133

def touch!
  @touched = true
end

#touched?Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/rspec-puppet/coverage.rb', line 137

def touched?
  !!@touched
end