Archive for the 'Installing Ruby' Category

First Steps through Ruby on Rails


Image Source:www.flickr.com

Classes, attributes, methods, and objects are the core of any Object-Oriented language. I am going to discuss how these classes, attributes, methods etc can be implemented in Ruby. There are two types of classes ‘close-ended’ and ‘open-ended’. If a class is close-ended, then new functionalities cannot be added to it without inheriting the class.
If a class is open-ended, then new functionalities can be added to it without inheriting it. Ruby is open-ended.
The class declared and defined just now is an empty class as it doesn’t contain any attributes or methods. You will notice that the procedure to define methods in ruby is very simple. def is the keyword used to define methods.
In ruby we don`t use brackets to define a set of code and we don`t use any semicolon at the end of the statements.

Tips in Installing Ruby

Installling Ruby can be accomplished in five easy steps!

Step 1 : Go to the latest Ruby release to download and install.

Step 2: Don’t forget to download and install the Aptana IDE.

Step 3: After installing the Aptana IDE, install Ruby extensions (it’s up to you anyway). Using Aptana IDE, click on Help>Software Updates>Find and Install>Search for new features for install.

Step 4 : Test by creating a Ruby project from Aptana IDE. All Ruby samples that you write will be stored here.

Step 5: Create the following sample code in file named ”HelloWorld.rb” and click on “Run HelloWorld.rb”. You will see the result of your first Ruby program output.

And that’s it! You can now start and enjoy working and learning the Ruby Programming!