879 reads

March 5, 2013

Case with Strings

You can also use non-integer types such as string. If multiple trigger values are specified in a when section, they may be of varying types – for example, both string and integers:

868 reads

March 5, 2013

More on Case

Working with Case Statement

949 reads

March 5, 2013

Case Break

Learn how to break to get specific output.

825 reads

March 5, 2013

Case Statement

When you need to take a variety of different actions based on the value of a single variable, multiple if..elsif tests are verbose and repetitive.

818 reads

March 5, 2013

Boolean Operators

and &&
These operators evaluate the left-hand side then, only if the result is true, they evaluate the right-hand side; and has lower precedence than &&

or ||

902 reads

March 5, 2013

Wrong Use of and or

This Example tell how not to use the and or operator as it does not give correct results every time.

961 reads

March 5, 2013

and or

Learn how to use and and or Operator in Ruby

859 reads

March 4, 2013

Using Upto and Downto

Using Upto and Downto continuous loop

857 reads

March 4, 2013

Using Until

Ruby also has an until loop which can be thought of as a ‘while not’ loop.

727 reads

March 4, 2013

Create An Array Using Two Sub-arrays

An array with two sub-arrays - i.e. 2 'rows' each with 4 elements