PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Range
U:RDoc::AnyMethod[iI" count:ETI"Range#count;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"VReturns the count of elements, based on an argument or block criterion, if given.;To:RDoc::Markup::BlankLine o; ; [I"IWith no argument and no block given, returns the number of elements:;T@o:RDoc::Markup::Verbatim; [I"(1..4).count # => 4 ;TI"(1...4).count # => 3 ;TI"('a'..'d').count # => 4 ;TI"('a'...'d').count # => 3 ;TI"%(1..).count # => Infinity ;TI"%(..4).count # => Infinity ;T:@format0o; ; [I"MWith argument +object+, returns the number of +object+ found in +self+, ;TI"'which will usually be zero or one:;T@o;; [I"(1..4).count(2) # => 1 ;TI"(1..4).count(5) # => 0 ;TI"(1..4).count('a') # => 0 ;T; 0o; ; [I"<With a block given, calls the block with each element; ;TI"Oreturns the number of elements for which the block returns a truthy value:;T@o;; [I"2(1..4).count {|element| element < 3 } # => 2 ;T; 0o; ; [I"Related: Range#size.;T: @fileI"range.c;T:0@omit_headings_from_table_of_contents_below0I"Qcount -> integer count(object) -> integer count {|element| ... } -> integer ;T0[ I"(*args);T@-FI" Range;TcRDoc::NormalClass00
[-] last-i.ri
[edit]
[-] include%3f-i.ri
[edit]
[-] count-i.ri
[edit]
[-] size-i.ri
[edit]
[-] bsearch-i.ri
[edit]
[-] end-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] max-i.ri
[edit]
[-] to_json-i.ri
[edit]
[-] first-i.ri
[edit]
[-] as_json-i.ri
[edit]
[-] reverse_each-i.ri
[edit]
[-] cover%3f-i.ri
[edit]
[-] to_a-i.ri
[edit]
[-] new-c.ri
[edit]
[-] minmax-i.ri
[edit]
[-] json_create-c.ri
[edit]
[-] min-i.ri
[edit]
[-] hash-i.ri
[edit]
[-] each-i.ri
[edit]
[-] step-i.ri
[edit]
[-] %3d%3d%3d-i.ri
[edit]
[-] eql%3f-i.ri
[edit]
[-] cdesc-Range.ri
[edit]
[-] member%3f-i.ri
[edit]
[-] %25-i.ri
[edit]
[-] exclude_end%3f-i.ri
[edit]
[-] begin-i.ri
[edit]
[-] overlap%3f-i.ri
[edit]
[+]
..
[-] entries-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] inspect-i.ri
[edit]