Hi Søòen!

Nice to see you here :-)

> If i have more classes... should they be in seperate files ????? .....

It depends.

Some people put'em each class in its own file, i.e. Klass can be found in
the file named "klass.rb". This is the normal case since it eases the
overview and mantainability of a system with more than a few classes (>2 :-)

The other approach is to put more classes into one file, but this tends to
get unmantainable as the system you're bulding grows. However, with small
prototypes and systems, it is often sufficient.

I've used both approaches. Once I need more than 2-4 classes, I tend to
quickly break'em out into their own files, and I very often need more than
2-4 classes....

> And where does the excecution of the program begin (if one has multible
> files.....) ....

At the first line!

Everything in Ruby, even the class declarations, is executable code.

For instance:
-------------------
class MyWorld
  def initialize(name)
    @name = name
  end

  puts "Execution in class declaration"

  def hello
    "Hello, World and #{@name}!"
  end
end

puts MyWorld.new("Soeren").hello
-------------------
produces:

Execution in class declaration
Hello, World and Soeren!
-------------------

This property (classes are first class objects) makes it possible to
dynamically reclassify objects at runtime, i.e. you can change the class of
an object at runtime.

If you're up to it :-), then read about classes and objects in Ruby at
http://www.rubycentral.com/book/classes.html
to find out more.

Also, have a closer look at www.rubycentral.com where you'll find useful
stuff and the whole book "Programming Ruby", by The Pragmatic Programmers,
available online

And of course, if you should ever fall in love with Ruby (the best ever for
scripting, prototyping and other such tasks), then you would have to buy the
book of course!

> (==> as i stated earlier - I'm used to have a main-method to cling on to )

Along the way, you will find many other things, you've been clinging on to,
that you'll have to let go. Most people like this once they get accustomed.

Happy Rubying!

Best,

Dennis Decker Jensen

P.S.

> > puts s.inspect
or the equivalent short form: "p s"
since "p" invokes "inspect" on the object ("s"), just like "puts" invokes
"to_s" on the object in question...