--- !ruby/object:RDoc::RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: Decodes <em>str</em> (which may contain binary data) according to the format string, returning an array of each value extracted. The format string consists of a sequence of single-character directives, summarized in the table at the end of this entry. Each directive may be followed by a number, indicating the number of times to repeat with this directive. An asterisk (``<tt>*</tt>'') will use up all remaining elements. The directives <tt>sSiIlL</tt> may each be followed by an underscore (``<tt>_</tt>'') to use the underlying platform's native size for the specified type; otherwise, it uses a platform-independent consistent size. Spaces are ignored in the format string. See also <tt>Array#pack</tt>.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "   &quot;abc \\0\\0abc \\0\\0&quot;.unpack('A6Z6')   #=&gt; [&quot;abc&quot;, &quot;abc &quot;]\n   &quot;abc \\0\\0&quot;.unpack('a3a3')           #=&gt; [&quot;abc&quot;, &quot; \\000\\000&quot;]\n   &quot;abc \\0abc \\0&quot;.unpack('Z*Z*')       #=&gt; [&quot;abc &quot;, &quot;abc &quot;]\n   &quot;aa&quot;.unpack('b8B8')                 #=&gt; [&quot;10000110&quot;, &quot;01100001&quot;]\n   &quot;aaa&quot;.unpack('h2H2c')               #=&gt; [&quot;16&quot;, &quot;61&quot;, 97]\n   &quot;\\xfe\\xff\\xfe\\xff&quot;.unpack('sS')     #=&gt; [-2, 65534]\n   &quot;now=20is&quot;.unpack('M*')             #=&gt; [&quot;now is&quot;]\n   &quot;whole&quot;.unpack('xax2aX2aX1aX2a')    #=&gt; [&quot;h&quot;, &quot;e&quot;, &quot;l&quot;, &quot;l&quot;, &quot;o&quot;]\n"
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: This table summarizes the various formats and the Ruby classes returned by each.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "   Format | Returns | Function\n   -------<tt>---------</tt>-----------------------------------------\n     A    | String  | arbitrary binary string with trailing\n          |         | nulls and ASCII spaces removed\n   -------<tt>---------</tt>-----------------------------------------\n     a    | String  | arbitrary binary string\n   -------<tt>---------</tt>-----------------------------------------\n     B    | String  | extract bits from each character (msb first)\n   -------<tt>---------</tt>-----------------------------------------\n     b    | String  | extract bits from each character (lsb first)\n   -------<tt>---------</tt>-----------------------------------------\n     C    | Fixnum  | extract a byte (C char) as an unsigned integer\n   -------<tt>---------</tt>-----------------------------------------\n     c    | Fixnum  | extract a byte (C char) as an integer\n   -------<tt>---------</tt>-----------------------------------------\n     d,D  | Float   | treat sizeof(double) characters as\n          |         | a native double\n   -------<tt>---------</tt>-----------------------------------------\n     E    | Float   | treat sizeof(double) characters as\n          |         | a double in little-endian byte order\n   -------<tt>---------</tt>-----------------------------------------\n     e    | Float   | treat sizeof(float) characters as\n          |         | a float in little-endian byte order\n   -------<tt>---------</tt>-----------------------------------------\n     f,F  | Float   | treat sizeof(float) characters as\n          |         | a native float\n   -------<tt>---------</tt>-----------------------------------------\n     G    | Float   | treat sizeof(double) characters as\n          |         | a double in network byte order\n   -------<tt>---------</tt>-----------------------------------------\n     g    | Float   | treat sizeof(float) characters as a\n          |         | float in network byte order\n   -------<tt>---------</tt>-----------------------------------------\n     H    | String  | extract hex nibbles from each character\n          |         | (most significant first)\n   -------<tt>---------</tt>-----------------------------------------\n     h    | String  | extract hex nibbles from each character\n          |         | (least significant first)\n   -------<tt>---------</tt>-----------------------------------------\n     I    | Integer | treat sizeof(int) (modified by _)\n          |         | successive characters as an unsigned\n          |         | native integer\n   -------<tt>---------</tt>-----------------------------------------\n     i    | Integer | treat sizeof(int) (modified by _)\n          |         | successive characters as a signed\n          |         | native integer\n   -------<tt>---------</tt>-----------------------------------------\n     L    | Integer | treat four (modified by _) successive\n          |         | characters as an unsigned native\n          |         | long integer\n   -------<tt>---------</tt>-----------------------------------------\n     l    | Integer | treat four (modified by _) successive\n          |         | characters as a signed native\n          |         | long integer\n   -------<tt>---------</tt>-----------------------------------------\n     M    | String  | quoted-printable\n   -------<tt>---------</tt>-----------------------------------------\n     m    | String  | base64-encoded (RFC 2045) (default)\n          |         | base64-encoded (RFC 4648) if followed by 0\n   -------<tt>---------</tt>-----------------------------------------\n     N    | Integer | treat four characters as an unsigned\n          |         | long in network byte order\n   -------<tt>---------</tt>-----------------------------------------\n     n    | Fixnum  | treat two characters as an unsigned\n          |         | short in network byte order\n   -------<tt>---------</tt>-----------------------------------------\n     P    | String  | treat sizeof(char *) characters as a\n          |         | pointer, and  return \\emph{len} characters\n          |         | from the referenced location\n   -------<tt>---------</tt>-----------------------------------------\n     p    | String  | treat sizeof(char *) characters as a\n          |         | pointer to a  null-terminated string\n   -------<tt>---------</tt>-----------------------------------------\n     Q    | Integer | treat 8 characters as an unsigned\n          |         | quad word (64 bits)\n   -------<tt>---------</tt>-----------------------------------------\n     q    | Integer | treat 8 characters as a signed\n          |         | quad word (64 bits)\n   -------<tt>---------</tt>-----------------------------------------\n     S    | Fixnum  | treat two (different if _ used)\n          |         | successive characters as an unsigned\n          |         | short in native byte order\n   -------<tt>---------</tt>-----------------------------------------\n     s    | Fixnum  | Treat two (different if _ used)\n          |         | successive characters as a signed short\n          |         | in native byte order\n   -------<tt>---------</tt>-----------------------------------------\n     U    | Integer | UTF-8 characters as unsigned integers\n   -------<tt>---------</tt>-----------------------------------------\n     u    | String  | UU-encoded\n   -------<tt>---------</tt>-----------------------------------------\n     V    | Fixnum  | treat four characters as an unsigned\n          |         | long in little-endian byte order\n   -------<tt>---------</tt>-----------------------------------------\n     v    | Fixnum  | treat two characters as an unsigned\n          |         | short in little-endian byte order\n   -------<tt>---------</tt>-----------------------------------------\n     w    | Integer | BER-compressed integer (see Array.pack)\n   -------<tt>---------</tt>-----------------------------------------\n     X    | ---     | skip backward one character\n   -------<tt>---------</tt>-----------------------------------------\n     x    | ---     | skip forward one character\n   -------<tt>---------</tt>-----------------------------------------\n     Z    | String  | with trailing nulls removed\n          |         | upto first null with *\n   -------<tt>---------</tt>-----------------------------------------\n     @    | ---     | skip to the offset given by the\n          |         | length argument\n   -------<tt>---------</tt>-----------------------------------------\n"
full_name: String#unpack
is_singleton: false
name: unpack
params: |
  str.unpack(format)   => anArray

visibility: public
