A question about Class and Object

Object.class is Class.
Object is type of Class.

I'm still confused with class and object and metaclass...

Try to think about it this way:
Object is a concept ("a thing")
Class is a concept ("a representation in ruby of realworld concepts")

In ruby, we use objects (things) of kind 'Class' to represent the
concepts. Thus the thingy 'Object' is of kind 'Class' and is used to
represent the concept of object. The thingy 'Class' is again of type
'Class' and is used to represent the ruby concept of a "concept that
represents the concept of 'concept'" (This makes it a meta-concept).

Thus in Ruby "Object" and "Class" are concept thingies, represented as
objects (thingies) of kind "Class". As for the number of methods, the
class-concept is a bit more specific than the generic "thingy" concept,
and therefore has an extra method.

I have probably confused you more. See the 'ruby object model"
presentation on "WhyRuby.rubyforge.org".

HTH,
Assaph

With your help, my brain starts building up concepts...:slight_smile:
Thank you.

For those who have same problems as mine, read the following link.
http://rubyforge.org/docman/view.php/251/96/ChrisPine_UROM.ppt
It's great.

kong

"Mehr, Assaph (Assaph)" <assaph@avaya.com> wrote in message
news:338366A6D2E2CA4C9DAEAE652E12A1DE166E16@au3010avexu1.global.avaya.com...

···

> Object.class is Class.
> Object is type of Class.

> I'm still confused with class and object and metaclass...

Try to think about it this way:
Object is a concept ("a thing")
Class is a concept ("a representation in ruby of realworld concepts")

In ruby, we use objects (things) of kind 'Class' to represent the
concepts. Thus the thingy 'Object' is of kind 'Class' and is used to
represent the concept of object. The thingy 'Class' is again of type
'Class' and is used to represent the ruby concept of a "concept that
represents the concept of 'concept'" (This makes it a meta-concept).

Thus in Ruby "Object" and "Class" are concept thingies, represented as
objects (thingies) of kind "Class". As for the number of methods, the
class-concept is a bit more specific than the generic "thingy" concept,
and therefore has an extra method.

I have probably confused you more. See the 'ruby object model"
presentation on "WhyRuby.rubyforge.org".

HTH,
Assaph

Well, thanks!

:slight_smile:

Chris

···

On Tue, 22 Jun 2004 14:08:13 +0900, Sam Sungshik Kong wrote:

With your help, my brain starts building up concepts...:slight_smile: Thank you.

For those who have same problems as mine, read the following link.
http://rubyforge.org/docman/view.php/251/96/ChrisPine_UROM.ppt It's
great.

For those who have same problems as mine, read the following link.
http://rubyforge.org/docman/view.php/251/96/ChrisPine_UROM.ppt
It's great.

I found so, too -- thanks Chris.

Even though it's a simple and intuitive distinction once you get it, this
distinction at issue (superclass vs. class) can be inexplicably confusing.

But then everything becomes simple when you understand Ruby's consistent
object model; an object's class and that class' inheritance do define the
object -- just don't fall into the trap of assuming that an object's class
defines it completely (singleton class methods like Module.nesting being
possibly the most common example of this in the standard library).