File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,18 @@ def pack(fmt, buffer: nil)
1010end
1111
1212class String
13- # call-seq:
14- # unpack(template, offset: 0, &block) -> array
13+ # call-seq:
14+ # unpack(template, offset: 0) {|o| .... } -> object
15+ # unpack(template, offset: 0) -> array
1516 #
16- # Extracts data from +self+.
17+ # Extracts data from +self+ to form new objects;
18+ # see {Packed Data}[rdoc-ref:packed_data.rdoc].
1719 #
18- # If +block+ is not given, forming objects that become the elements
19- # of a new array, and returns that array. Otherwise, yields each
20- # object.
20+ # With a block given, calls the block with each unpacked object.
2121 #
22- # See {Packed Data}[rdoc-ref:packed_data.rdoc].
22+ # With no block given, returns an array containing the unpacked objects.
23+ #
24+ # Related: see {Converting to Non-String}[rdoc-ref:String@Converting+to+Non--5CString].
2325 def unpack ( fmt , offset : 0 )
2426 Primitive . attr! :use_block
2527 Primitive . pack_unpack ( fmt , offset )
You can’t perform that action at this time.
0 commit comments