lib/puppet/resource/catalog.rb
def filter(&block)
    # to_catalog must take place in a context where current_environment is set to the same env as the
    # environment set in the catalog (if it is set)
    # See PUP-3755
    if environment_instance
      Puppet.override({:current_environment => environment_instance}) do
        to_catalog :to_resource, &block
      end
    else
      # If catalog has no environment_instance, hope that the caller has made sure the context has the
      # correct current_environment
      to_catalog :to_resource, &block
    end
  end
# filter out the catalog, applying +block+ to each resource.
# If the block result is false, the resource will
# be kept otherwise it will be skipped
filter out the catalog, applying +block+ to each resource.
If the block result is false, the resource will
be kept otherwise it will be skipped
filter out the catalog applying + block + to each resource . If the block result is false the resource will be kept otherwise it will be skipped
def filter(&block)
    if environment_instance
      Puppet.override({:current_environment => environment_instance}) do
        to_catalog :to_resource, &block
      end
    else
      to_catalog :to_resource, &block
    end
  end
def filter ( & block ) if environment_instance Puppet . override ( { :current_environment => environment_instance } ) do to_catalog :to_resource , & block end else to_catalog :to_resource , & block end end
filter out the catalog, applying +block+ to each resource.
filter out the catalog applying + block + to each resource .
# to_catalog must take place in a context where current_environment is set to the same env as the # environment set in the catalog (if it is set) # See PUP-3755 # If catalog has no environment_instance, hope that the caller has made sure the context has the # correct current_environment
block