1. Home
  2. Computing & Technology
  3. Ruby

Ruby's Basic Features: Blocks, Loops, Arrays & more

Like any other programming language, Ruby has a number of basic features that make up the code. Learn what these features are and how to use them in your code.
Modules
In any programming language, you need some way to prevent naming clashes. This is especially true when you're using at least one third party library, where you have no control over the naming scheme. In the past, naming conventions would be used. It's not uncommon to see C programs with names like [i]mylibrary_some_function[/i]. However, Ruby has a more powerful solution: modules.
How Can I Store Key/Value Pairs in Ruby?
Storing key/value pairs in Ruby doesn't always need to be accomplished by using a hash. You can also use the Struct and OpenStruct classes.
How to Create and Use Hashes in Ruby
This article explains and teaches how to use a associative arrays (hashes) as a way to store multiple variables in one data structure.
How to Create Arrays in Ruby
This article explains and teaches how to use an array and an associative array (hash) as a way to store multiple variables in one data structure.
How to Use Loops in Ruby
How to use loops in Ruby
How to Use and Create Blocks in Ruby
How to use blocks in Ruby.
Input and Output
The basic IO methods are often overlooked by many Ruby programmers. How often have you used the gets and puts methods without giving them a second glance? Learn all the features of these methods to better put them to use in your code.
Explore Ruby
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Ruby
  4. Beginning Ruby
  5. Ruby's Basic Features

©2009 About.com, a part of The New York Times Company.

All rights reserved.