D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Array
/
Filename :
count-i.ri
back
Copy
U:RDoc::AnyMethod[iI" count:ETI"Array#count;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"+Returns a count of specified elements.;To:RDoc::Markup::BlankLine o; ; [I"FWith no argument and no block, returns the count of all elements:;T@o:RDoc::Markup::Verbatim; [I"+[0, :one, 'two', 3, 3.0].count # => 5 ;T:@format0o; ; [I"YWith argument +object+ given, returns the count of elements <tt>==</tt> to +object+:;T@o;; [I".[0, :one, 'two', 3, 3.0].count(3) # => 2 ;T; 0o; ; [I"LWith no argument and a block given, calls the block with each element; ;TI"Nreturns the count of elements for which the block returns a truthy value:;T@o;; [I"8[0, 1, 2, 3].count {|element| element > 1 } # => 2 ;T; 0o; ; [I"TWith argument +object+ and a block given, issues a warning, ignores the block, ;TI"?and returns the count of elements <tt>==</tt> to +object+.;T@o; ; [I"NRelated: see {Methods for Querying}[rdoc-ref:Array@Methods+for+Querying].;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"Qcount -> integer count(object) -> integer count {|element| ... } -> integer ;T0[ I"(*args);T@)FI" Array;TcRDoc::NormalClass00