# Restricting Objects in Ruby Shell

**URL:** <https://www.ruby-forum.com/t/restricting-objects-in-ruby-shell/106580>\
**Category:** Ruby\
**Created:** [June 12, 2007, 6:00am UTC](https://www.ruby-forum.com/t/restricting-objects-in-ruby-shell/106580 "2007-06-12T06:00:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [June 12, 2007, 6:00am UTC](https://www.ruby-forum.com/t/restricting-objects-in-ruby-shell/106580/1 "2007-06-12T06:00:28Z")

</div>

Is there a way in which the ruby IRB interface can be restricted. I  
would  
like only objects defined by my application can be accessed and only  
some of  
the ruby in-built objects can be made available to the user.

For example if I declare a class Employee then only this class should be  
available through the irb session.

---

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [June 12, 2007, 7:24am UTC](https://www.ruby-forum.com/t/restricting-objects-in-ruby-shell/106580/2 "2007-06-12T07:24:36Z")

</div>

Look at \_why the lucky stiff’s sandbox. With some work it could what  
you want probably.

–Jeremy

On 6/11/07, SunRaySon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there a way in which the ruby IRB interface can be restricted. I would  
> like only objects defined by my application can be accessed and only some of  
> the ruby in-built objects can be made available to the user.
> 
> For example if I declare a class Employee then only this class should be  
> available through the irb session.

–  
[http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)

My free Ruby e-book:  
[http://www.humblelittlerubybook.com/book/](http://www.humblelittlerubybook.com/book/)

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)
