# How?

**URL:** <https://www.ruby-forum.com/t/how/172800>\
**Category:** Ruby\
**Created:** [July 28, 2009, 11:02am UTC](https://www.ruby-forum.com/t/how/172800 "2009-07-28T11:02:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 28, 2009, 11:02am UTC](https://www.ruby-forum.com/t/how/172800/1 "2009-07-28T11:02:54Z")

</div>

Hi friends,

I am a new ruby programmer. I have a question for all of you,

class ABC

end

As I read that Ruby is made in C. I checked the file class.c

There one structure is defined as RClass

struct RClass  
{  
struct RBasic basic;  
struct st\_table \*iv\_tbl  
struct st\_table \*m\_tbl;  
Value super  
}

when we defined a class in Ruby how does the things happen at  
fundamental level.

???  
how ABC is a class in RUBY?

---

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 28, 2009, 4:35pm UTC](https://www.ruby-forum.com/t/how/172800/2 "2009-07-28T16:35:20Z")

</div>

I suggest you go the the Pragmatic Programmer’s bookshelf and get the  
Pickaxe book, Programming  
Ruby[http://pragprog.com/titles/ruby/programming-ruby](http://pragprog.com/titles/ruby/programming-ruby).  
This is a very good book, very readable. You will enjoy it.

2009/7/28 Hunt H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> There one structure is defined as RClass  
> when we defined a class in Ruby how does the things happen at  
> fundamental level.
> 
> ## ??? how ABC is a class in RUBY?
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–  
Regards,

Ken

Seek wisdom through disbelief

---

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 28, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/how/172800/3 "2009-07-28T16:39:26Z")

</div>

On Tue, 28 Jul 2009 18:02:56 +0900, Hunt H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> There one structure is defined as RClass  
> when we defined a class in Ruby how does the things happen at  
> fundamental level.
> 
> ???  
> how ABC is a class in RUBY?

Because you defined it as a class when you said:  
def ABC  
end

Why does it matter how it is turned into a class in C? It has been  
defined  
as a class, by you, in Ruby and thus is a class.

---

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 28, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/how/172800/4 "2009-07-28T19:46:13Z")

</div>

On Jul 28, 10:38 am, Kyle S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > when we defined a class in Ruby how does the things happen at  
> > as a class, by you, in Ruby and thus is a class.
> 
> –
> 
> - Kyle

Eigenclass has a guide outline for teaching yourself the “basics” of  
Ruby at [eigenclass.org](http://eigenclass.org/hiki.rb?ruby+internals+guide). Also just  
googling today I found this presentation  
[http://mtnwestrubyconf2008.confreaks.com/11farley.html](http://mtnwestrubyconf2008.confreaks.com/11farley.html)  
from MontainWest Ruby last year, which really makes Ruby’s internal  
handling of class hierarchies and method dispatching clear.

---

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 29, 2009, 12:17pm UTC](https://www.ruby-forum.com/t/how/172800/5 "2009-07-29T12:17:49Z")

</div>

Hunt H. wrote:

> when we defined a class in Ruby how does the things happen at  
> fundamental level.

There’s some stuff on interfacing Ruby internals with C at  
[http://www.ruby-doc.org/docs/ProgrammingRuby/html/ext\_ruby.html](http://www.ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html)

An object reference is a VALUE. Most people don’t have to worry about  
how a Class might be different from any other type of Object internally.  
If you do, the source code is all there… it’s probably just not the  
right place to start 🙂
