mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 05:29:10 +02:00
[DOC] Mention block mode of String#unpack
This commit is contained in:
parent
e7144af750
commit
65a0795c3f
Notes:
git
2024-09-29 11:45:37 +00:00
1 changed files with 7 additions and 3 deletions
10
pack.rb
10
pack.rb
|
@ -11,10 +11,14 @@ end
|
|||
|
||||
class String
|
||||
# call-seq:
|
||||
# unpack(template, offset: 0) -> array
|
||||
# unpack(template, offset: 0, &block) -> array
|
||||
#
|
||||
# Extracts data from +self+.
|
||||
#
|
||||
# If +block+ is not given, forming objects that become the elements
|
||||
# of a new array, and returns that array. Otherwise, yields each
|
||||
# object.
|
||||
#
|
||||
# Extracts data from +self+, forming objects that become the elements of a new array;
|
||||
# returns that array.
|
||||
# See {Packed Data}[rdoc-ref:packed_data.rdoc].
|
||||
def unpack(fmt, offset: 0)
|
||||
Primitive.attr! :use_block
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue