1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Loops & Iterators in Ruby

Discussion in 'Ruby on Rails' started by arunsoni1989, May 17, 2012.

  1. arunsoni1989

    arunsoni1989 New Member

    Ruby provides the basic while and unless loops and iterators. Let us go through while and until first before looking at iterators.

    A "while" loop defines that a statement or block of code is to be rerun time and time again while a condition remains true, and then execution is to continue after the statement or block. An "until" loop says that the block is to be performed until the condition goes true (i.e. while it is false).

    Just like the "if" and "unless", "while" and "until" are written with an 'end' key-worded block, or as modified after a piece of code.
     

Share This Page