def unpack(string)
      total = ""
      parts = {}

      directives.each_with_index do |directive, i|
        total << directive.to_s(parts)
        parts[directive.name] = string.unpack(total)[i]
      end

      parts.delete(:null) {}
      parts
    end
def unpack(string)
      total = ""
      parts = {}

      directives.each_with_index do |directive, i|
        total << directive.to_s(parts)
        parts[directive.name] = string.unpack(total)[i]
      end

      parts.delete(:null) {}
      parts
    end
Unpacks the given string with the directives.  Returns a hash
 containing the values, with the keys being the names of the
 directives.

 @param string [String] the packed string.
 @return [Hash<Symbol, Object>] the unpacked data.