Sha256: 11482bbc2e575712ef6b42066940d072061703890eab3311584b68c7523b85de

Contents?: true

Size: 1.92 KB

Versions: 12

Compression:

Stored size: 1.92 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:downto:@docstringIC:YARD::Docstring"ÜIterates <em>block</em>, passing decreasing values from <i>int</i>
down to and including <i>limit</i>.

   5.downto(1) { |n| print n, ".. " }
   print "  Liftoff!\n"

<em>produces:</em>

   5.. 4.. 3.. 2.. 1..   Liftoff!
:@objectu:YARD::StubProxyInteger#downto:
@summary0:	@all"Iterates <em>block</em>, passing decreasing values from <i>int</i>
down to and including <i>limit</i>.

   5.downto(1) { |n| print n, ".. " }
   print "  Liftoff!\n"

<em>produces:</em>

   5.. 4.. 3.. 2.. 1..   Liftoff!


@overload downto(limit)
  @yield [i]
  @return [Integer]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Integer#downto;;;IC;	"
;
u;Integer#downto;0;
"!@yield [i]
@return [Integer];[;[o:YARD::Tags::Tag
;
0;0:@types["i:
@text":@tag_name"
yieldo;
;
0;0;["Integer;";"return;0:@parameters[[:
limit0;0:@signature"downto(limit);"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["numeric.c0:@namespaceu;Integer:
@path"Integer#downto;[:@visibility:public:@source"&/*
 *  call-seq:
 *     int.downto(limit) {|i| block }     => int
 *
 *  Iterates <em>block</em>, passing decreasing values from <i>int</i>
 *  down to and including <i>limit</i>.
 *
 *     5.downto(1) { |n| print n, ".. " }
 *     print "  Liftoff!\n"
 *
 *  <em>produces:</em>
 *
 *     5.. 4.. 3.. 2.. 1..   Liftoff!
 */

static VALUE
int_downto(from, to)
    VALUE from, to;
{
    RETURN_ENUMERATOR(from, 1, &to);

    if (FIXNUM_P(from) && FIXNUM_P(to)) {
    long i, end;

    end = FIX2LONG(to);
    for (i=FIX2LONG(from); i >= end; i--) {
        rb_yield(LONG2FIX(i));
    }
    }
    else {
    VALUE i = from, c;

    while (!(c = rb_funcall(i, '<', 1, to))) {
        rb_yield(i);
        i = rb_funcall(i, '-', 1, INT2FIX(1));
    }
    if (NIL_P(c)) rb_cmperr(i, to);
    }
    return from;
}:@source_type:c

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
pry-doc-0.4.4 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Integer/downto_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Integer/downto_i.dat