From: "Roger Grosswiler" <roger / gwch.net>
>
> i am a complete beginner in programming, i can handle some
> lines in perl. Does anybody know a EASY source to learn
> oo-programming?

One of the features Ruby shares with languages like Perl is
you can even try things out interactively, from the shell.
In Ruby, you can even create objects right from the interactive
ruby shell (irb) and experiment with them.

$ irb --simple-prompt
# let's create a generic object instance out of some electrons:
>> o = Object.new
=> #<Object:0x2bb3a50>
# cool! a cluster of some electrons ready to do our bidding!
# let's ask it to time travel!
>> o.invent_the_warp_drive
 NoMethodError: undefined method `invent_the_warp_drive'
   for #<MyObject:0x2bb3a50> from (irb):29
# well shucks.
# ok, maybe this Object can tell us what it *can* do??
>> o.methods.sort
=> ["==", "===", "=~", "__id__", "__send__", "class", "clone", "display",
 "dup", "eql?", "equal?", "extend", "freeze", "frozen?", "hash", "id",
 "inspect", "instance_eval", "instance_of?", "instance_variable_get",
 "instance_variable_set", "instance_variables", "is_a?", "kind_of?",
 "method", "methods", "nil?", "object_id", "private_methods",
 "protected_methods", "public_methods", "respond_to?", "send",
 "singleton_methods", "taint", "tainted?", "to_a", "to_s", "type",
 "untaint"]
# that's quite a few methods.  how many is that?
o.methods.length
=> 40
# one called untaint, eh??? what kind of object is this, again?????
>> o.class
=> Object
# ok.. plain old Object... probably does a bunch of generic stuff.
# Do you think it could possibly be tainted?
>> o.tainted?
=> false
# Naw, we personally supervised the creation of this object.
# No chance for it to be tainted by untrusted data!
# What about Strings? Are they objects?
>> "hello".kind_of? Object
=> true
# That seems consistent. So even a string is an Object...!
>> "hello".class
=> String
>> "hello".length
=> 5
>> "hello".capitalize
=> "Hello"
# Any chance it's easy to create our own kind of Object?
>> class NiftyObject
>>   def greet
>>     p "just a simple hello"
>>   end
>> end
=> nil
# Let's make one!
>> o = NiftyObject.new
=> #<NiftyObject:0x2bce768>
# Did we really just rearrange some electrons into a new NiftyObject ???
>> o.class
=> NiftyObject
>> o.kind_of? NiftyObject
=> true
>> o.greet
"just a simple hello"
=> nil

A couple links that emphasize interactive learning about 
objects (in Ruby)
http://www.math.umd.edu/~dcarrera/ruby/0.3/
http://www.poignantguide.net/ruby/chapter-3.html
  (Ch. 3 of http://www.poignantguide.net/ruby/ )


Hope this helps & Good Luck!

Regards,

Bill