lib/custom_facts/util/fact.rb
# Returns the value for this fact. This searches all resolutions by
# suitability and weight (see {Facter::Util::Resolution}). If no
# suitable resolution is found, it returns nil.
#
# @api public
Returns the value for this fact. This searches all resolutions by
suitability and weight . If no
suitable resolution is found, it returns nil.
Returns the value for this fact . This searches all resolutions by suitability and weight . If no suitable resolution is found it returns nil .
def value
        return @value if @value
        if @resolves.empty?
          LegacyFacter.debug format('No resolves for %<name>s', name: @name)
          return nil
        end
        searching do
          suitable_resolutions = sort_by_weight(find_suitable_resolutions(@resolves))
          @value = find_first_real_value(suitable_resolutions)
          announce_when_no_suitable_resolution(suitable_resolutions)
          announce_when_no_value_found(@value)
          @value = resolve_value
        end
        @value
      end
def value return @value if @value if @resolves . empty? LegacyFacter . debug format ( 'No resolves for %<name>s' , name : @name ) return nil end searching do suitable_resolutions = sort_by_weight ( find_suitable_resolutions ( @resolves ) ) @value = find_first_real_value ( suitable_resolutions ) announce_when_no_suitable_resolution ( suitable_resolutions ) announce_when_no_value_found ( @value ) @value = resolve_value end @value end
Returns the value for this fact.
Returns the value for this fact .
api
None