lib/custom_facts/util/fact.rb
# Define a new named resolution or return an existing resolution with
# the given name.
#
# @param resolution_name [String] The name of the resolve to define or look up
# @param options [Hash] A hash of options to set on the resolution
# @return [Facter::Util::Resolution]
#
# @api public
Define a new named resolution or return an existing resolution with
the given name.
Define a new named resolution or return an existing resolution with the given name .
def define_resolution(resolution_name, options = {}, &block)
        resolution_type = options.delete(:type) || :simple
        resolve = create_or_return_resolution(resolution_name, resolution_type)
        resolve.options(options) unless options.empty?
        resolve.evaluate(&block) if block
        resolve
      rescue StandardError => e
        LegacyFacter
          .log_exception(e, "Unable to add resolve #{resolution_name.inspect} for fact #{@name}: #{e.message}")
      end
def define_resolution ( resolution_name , options = { } , & block ) resolution_type = options . delete ( :type ) || :simple resolve = create_or_return_resolution ( resolution_name , resolution_type ) resolve . options ( options ) unless options . empty? resolve . evaluate ( & block ) if block resolve rescue StandardError => e LegacyFacter . log_exception ( e , "Unable to add resolve #{resolution_name.inspect} for fact #{@name}: #{e.message}" ) end
Define a new named resolution or return an existing resolution with
the given name.
Define a new named resolution or return an existing resolution with the given name .
None
Facter::Util::Resolution
resolution_name
The name of the resolve to define or look up
The name of the resolve to define or look up
options
A hash of options to set on the resolution
A hash of options to set on the resolution
block
api
None