D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Enumerable
/
Filename :
find_index-i.ri
back
Copy
U:RDoc::AnyMethod[iI"find_index:ETI"Enumerable#find_index;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NReturns the index of the first element that meets a specified criterion, ;TI"*or +nil+ if no such element is found.;To:RDoc::Markup::BlankLine o; ; [I"#With argument +object+ given, ;TI"Ireturns the index of the first element that is <tt>==</tt> +object+:;T@o:RDoc::Markup::Verbatim; [I"1['a', 'b', 'c', 'b'].find_index('b') # => 1 ;T:@format0o; ; [I"CWith a block given, calls the block with successive elements; ;TI"Jreturns the first element for which the block returns a truthy value:;T@o;; [I"R['a', 'b', 'c', 'b'].find_index {|element| element.start_with?('b') } # => 1 ;TI"R{foo: 0, bar: 1, baz: 2}.find_index {|key, value| value > 1 } # => 2 ;T; 0o; ; [I"@With no argument and no block given, returns an Enumerator.;T: @fileI"enum.c;T:0@omit_headings_from_table_of_contents_below0I"qfind_index(object) -> integer or nil find_index {|element| ... } -> integer or nil find_index -> enumerator ;T0[ I" (p1);T@"FI"Enumerable;TcRDoc::NormalModule00