G
Glenn
You'll excuse me, but I'm coming from a Visual Basic background and am
trying to give myself a good OO knowledge using Ruby (I just LOVE the
Ruby language, having failed miserably at Smalltalk!).
So this is a relatively simple OO question.
Supposing I have a simple ruby program containing just this code:
class Window
#some code here (assume a method "show" is defined somewhere)
end
w = Window.new #<<<
w.show #<<<
Now I understand that Ruby is pure-OOP. And I guess that class
"Window" is implicitly deriving from superclass Object.
It's the two lines at the end that confuse me. My natural though is
they are "global", but in a pure-OO world, they've got to fit into a
class somewhere? If so, are they actually fitting into (extending)
class "Object" in some way? Where? How?
Ta muchly
Glenn.
trying to give myself a good OO knowledge using Ruby (I just LOVE the
Ruby language, having failed miserably at Smalltalk!).
So this is a relatively simple OO question.
Supposing I have a simple ruby program containing just this code:
class Window
#some code here (assume a method "show" is defined somewhere)
end
w = Window.new #<<<
w.show #<<<
Now I understand that Ruby is pure-OOP. And I guess that class
"Window" is implicitly deriving from superclass Object.
It's the two lines at the end that confuse me. My natural though is
they are "global", but in a pure-OO world, they've got to fit into a
class somewhere? If so, are they actually fitting into (extending)
class "Object" in some way? Where? How?
Ta muchly
Glenn.