Sha256: 1724052c5aa6eeaf0ae77cd821d42c605c8dfff9457e4e4faf56b9a717cf0cd3
Contents?: true
Size: 768 Bytes
Versions: 33
Compression:
Stored size: 768 Bytes
Contents
class Puppet::Pops::Evaluator::Collectors::CatalogCollector < Puppet::Pops::Evaluator::Collectors::AbstractCollector # Creates a CatalogCollector using the AbstractCollector's # constructor to set the scope and overrides # # param [Symbol] type the resource type to be collected # param [Proc] query the query which defines which resources to match def initialize(scope, type, query, overrides = nil) super(scope, overrides) @query = query @type = Puppet::Resource.new(type, "whatever").type end # Collects virtual resources based off a collection in a manifest def collect t = @type q = @query scope.compiler.resources.find_all do |resource| resource.type == t && (q ? q.call(resource) : true) end end end
Version data entries
33 entries across 33 versions & 1 rubygems