Vidhi,

Welcome to Ruby.

> 1) Just like in C++ you have a .h and a .cpp file , In this language how
> would you store your file. In other words if I open emacs and want to
> write a very simple small class in what format would I save this file ?

You store all your code in .rb files. There is no separate header file. You 
declare and define a class in one place, just like in Java. (That's not 
strictly true; in Ruby you can "re-open" a class and add more methods later. 
Don't worry about that yet.)

superclass.rb:

	class Superclass
		attr_accessor :super_instance_var
		def initialize
			@super_instance_var = 42
		end
	end

myclass.rb

	require 'superclass'

	class MyClass < Superclass
		attr_accessor :my_instance_var
		def initialize
			@my_instance_var = 'hello'
		end
	end

another.rb

	require 'myclass'

	mc = MyClass.new
	puts mc.my_instance_var
	puts mc.super_instance_var

> 2) How do you compile your code? What is the syntax?

Ruby is an interpreted language, which means that it doesn't need to be 
compiled before you run it. To run "another.rb" above, type

	ruby another.rb

> 3) Do you need a main and a makefile ? I am sure you would need a main
> to test it . If yes how do you save the main? In what format?

You don't need a main method. All Ruby code is executed as it is seen by the 
interpreter. Some of the code above (superclass.rb and myclass.rb) define 
classes and some of the code (another.rb) creates an instance of a class and 
prints some output.

I hope this helps.

Jim
-- 
Jim Menard, jimm / io.com, http://www.io.com/~jimm