def set_value(new_value, name_in = nil)
      if name_in.nil?
        if new_value.is_a?(Proc)
          return @value = new_value.call(@value)
        end

        return @value = new_value
      end

      parts = if name_in.is_a?(String)
        name_in.split("::")
      elsif name_in.is_a?(Array)
        name_in.map do |item|
          if item.is_a?(String)
            item
          elsif item.is_a?(Hash) && item.key?("regexp")
            Regexp.new(item["regexp"])
          else
            raise ArgumentError, "Unable to interpret structure item: #{item.inspect}"
          end
        end
      else
        raise ArgumentError, "Unable to interpret structure: #{name_in.inspect}"
      end

      set_structured_value(@value, parts, new_value)
    end
def set_value(new_value, name_in = nil)
      if name_in.nil?
        if new_value.is_a?(Proc)
          return @value = new_value.call(@value)
        end

        return @value = new_value
      end

      parts = if name_in.is_a?(String)
        name_in.split("::")
      elsif name_in.is_a?(Array)
        name_in.map do |item|
          if item.is_a?(String)
            item
          elsif item.is_a?(Hash) && item.key?("regexp")
            Regexp.new(item["regexp"])
          else
            raise ArgumentError, "Unable to interpret structure item: #{item.inspect}"
          end
        end
      else
        raise ArgumentError, "Unable to interpret structure: #{name_in.inspect}"
      end

      set_structured_value(@value, parts, new_value)
    end
Set the value of the fact. If the name is specified, this will dig into a structured fact to set
 the value within the structure.

 new_value - An object with the new value for the fact
 name_in   - An optional String to dig into the structure (formatted with :: indicating hash delimiters)