Ruby 1

Cover page image

Cay S. Horstmann

Why Ruby?

Ruby Features


More about Functions


Open Classes



Step 1

  1. Install Ruby. It's easy with Linux, Mac OS, or Cygwin
  2. Start the interactive Ruby console by typing irb.
  3. Make an array containing a number, a string, and a Boolean value and store it in a variable a. How did you do that?
  4. Run the quack function on all elements of the array, using a block. How did you do that?

Step 2

Step 3