lib/octofacts_updater/fact.rb
# Get the value of the fact. If the name is specified, this will dig into a structured fact to pull
# out the value within the structure.
#
# name_in - An optional String to dig into the structure (formatted with :: indicating hash delimiters)
#
# Returns the value of the fact.
Get the value of the fact. If the name is specified, this will dig into a structured fact to pull
out the value within the structure.

An optional String to dig into the structure (formatted with :: indicating hash delimiters)

Returns the value of the fact.
Get the value of the fact . If the name is specified this will dig into a structured fact to pull out the value within the structure . An optional String to dig into the structure ( formatted with :: indicating hash delimiters ) Returns the value of the fact .
def value(name_in = nil)
      return @value if name_in.nil?
      return unless @value.is_a?(Hash)
      pointer = @value
      parts = name_in.split("::")
      last_part = parts.pop
      parts.each do |part|
        return unless pointer[part].is_a?(Hash)
        pointer = pointer[part]
      end
      pointer[last_part]
    end
def value ( name_in = nil ) return @value if name_in . nil? return unless @value . is_a? ( Hash ) pointer = @value parts = name_in . split ( "::" ) last_part = parts . pop parts . each do | part | return unless pointer [ part ] . is_a? ( Hash ) pointer = pointer [ part ] end pointer [ last_part ] end
Get the value of the fact.
Get the value of the fact .
# Just a normal lookup -- return the value # Structured lookup returns nil unless the fact is actually structured. # Dig into the hash to pull out the desired value.
name_in
<not_specific>