# Communication between objects

**URL:** <https://www.ruby-forum.com/t/communication-between-objects/69354>\
**Category:** Ruby\
**Created:** [September 20, 2006, 3:00pm UTC](https://www.ruby-forum.com/t/communication-between-objects/69354 "2006-09-20T15:00:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tod](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tod](https://www.ruby-forum.com/u/tod)\
**Post date:** [September 20, 2006, 3:00pm UTC](https://www.ruby-forum.com/t/communication-between-objects/69354/1 "2006-09-20T15:00:43Z")

</div>

I posted a question on this topic yesterday but used an example  
specific to my application. But I wanted to re-post with a slightly  
more abstract example and see what responses there are. My question:  
How does ruby implement passing messages between objects.

An example might be a course registration system. In this system you  
have student objects and a registration object. Your student object  
can call the method student.register\_for\_course method. Now, before the  
studen can register for the course we need to make sure the student has  
met all the prerequisites. So ideally the student object would pass  
the request to the registration object along with the name of the  
course, the students id, etc. The registration object would call the  
registration.prerequisite\_met? method. Then it would return the  
response back to the student object which could then procede with  
either registering for the class or indicate that registration would  
not be allowed.

Someone yesterday said you would create a superclass that both of these  
objects would share and this superclass would handle communication  
between the objects. I can see how that would work. But is that the  
only way? Is there no way for ruby objects to communicate directly with  
one another?

Thanks. TOD
