ÿØÿà JFIF ÿÛ „ ( %!1!%*+...983,7(-.-
find_all-i.ri 0000644 00000001642 15237316316 0007110 0 ustar 00 U:RDoc::AnyMethod[iI"
find_all:ETI"Enumerable#find_all;TF:privateo:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"@Returns an array containing elements selected by the block.;To:RDoc::Markup::BlankLine o;
; [I"CWith a block given, calls the block with successive elements; ;TI"Sreturns an array of those elements for which the block returns a truthy value:;T@o:RDoc::Markup::Verbatim; [I"C(0..9).select {|element| element % 3 == 0 } # => [0, 3, 6, 9]
;TI"Na = {foo: 0, bar: 1, baz: 2}.select {|key, value| key.start_with?('b') }
;TI"a # => {:bar=>1, :baz=>2}
;T:@format0o;
; [I"1With no block given, returns an \Enumerator.;T@o;
; [I"Related: #reject.;T:
@fileI"enum.c;T:0@omit_headings_from_table_of_contents_below0I";select {|element| ... } -> array
select -> enumerator
;T0[[I"select;T@ [I"filter;T@ I"();T@FI"Enumerable;TcRDoc::NormalModule00 zip-i.ri 0000644 00000004774 15237316316 0006153 0 ustar 00 U:RDoc::AnyMethod[iI"zip:ETI"Enumerable#zip;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"LWith no block given, returns a new array +new_array+ of size self.size ;TI" whose elements are arrays. ;TI"-Each nested array new_array[n] ;TI":is of size other_enums.size+1, and contains:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o;
; [I" The +n+-th element of self.;To;;0; [o;
; [I"5The +n+-th element of each of the +other_enums+.;T@o;
; [I"6If all +other_enums+ and self are the same size, ;TI"Lall elements are included in the result, and there is no +nil+-filling:;T@o:RDoc::Markup::Verbatim; [I"a = [:a0, :a1, :a2, :a3]
;TI"b = [:b0, :b1, :b2, :b3]
;TI"c = [:c0, :c1, :c2, :c3]
;TI"d = a.zip(b, c)
;TI"Qd # => [[:a0, :b0, :c0], [:a1, :b1, :c1], [:a2, :b2, :c2], [:a3, :b3, :c3]]
;TI"
;TI""f = {foo: 0, bar: 1, baz: 2}
;TI""g = {goo: 3, gar: 4, gaz: 5}
;TI""h = {hoo: 6, har: 7, haz: 8}
;TI"d = f.zip(g, h)
;TI"d # => [
;TI"1 # [[:foo, 0], [:goo, 3], [:hoo, 6]],
;TI"1 # [[:bar, 1], [:gar, 4], [:har, 7]],
;TI"0 # [[:baz, 2], [:gaz, 5], [:haz, 8]]
;TI" # ]
;T:@format0o;
; [I"self.size with +nil+:;T@o;; [
I"a = [:a0, :a1, :a2, :a3]
;TI"b = [:b0, :b1, :b2]
;TI"c = [:c0, :c1]
;TI"d = a.zip(b, c)
;TI"Qd # => [[:a0, :b0, :c0], [:a1, :b1, :c1], [:a2, :b2, nil], [:a3, nil, nil]]
;T;0o;
; [I";If any enumerable in other_enums is larger than self, ;TI"'its trailing elements are ignored:;T@o;; [
I"a = [:a0, :a1, :a2, :a3]
;TI"#b = [:b0, :b1, :b2, :b3, :b4]
;TI"(c = [:c0, :c1, :c2, :c3, :c4, :c5]
;TI"d = a.zip(b, c)
;TI"Qd # => [[:a0, :b0, :c0], [:a1, :b1, :c1], [:a2, :b2, :c2], [:a3, :b3, :c3]]
;T;0o;
; [I"HWhen a block is given, calls the block with each of the sub-arrays ;TI"$(formed as above); returns nil:;T@o;; [ I"a = [:a0, :a1, :a2, :a3]
;TI"b = [:b0, :b1, :b2, :b3]
;TI"c = [:c0, :c1, :c2, :c3]
;TI"4a.zip(b, c) {|sub_array| p sub_array} # => nil
;T;0o;
; [I"Output:;T@o;; [ I"[:a0, :b0, :c0]
;TI"[:a1, :b1, :c1]
;TI"[:a2, :b2, :c2]
;TI"[:a3, :b3, :c3];T;0:
@fileI"enum.c;T:0@omit_headings_from_table_of_contents_below0I"Hzip(*other_enums) -> array
zip(*other_enums) {|array| ... } -> nil
;T0[ I"(*args);T@\FI"Enumerable;TcRDoc::NormalModule00 minmax_by-i.ri 0000644 00000001706 15237316316 0007324 0 ustar 00 U:RDoc::AnyMethod[iI"minmax_by:ETI"Enumerable#minmax_by;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"7Returns a 2-element array containing the elements ;TI"