# Re: final/closed classes in Ruby (was: Sharp knives and glue

**URL:** <https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94717>\
**Category:** Ruby\
**Created:** [May 11, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94717 "2006-05-11T23:47:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [May 11, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94717/1 "2006-05-11T23:47:00Z")

</div>

> -----Original Message-----  
> From: Gregory S. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
> Sent: Thursday, May 11, 2006 3:39 PM  
> To: ruby-talk ML  
> Subject: Re: final/closed classes in Ruby (was: Sharp knives and glue)

> class Foo  
> def test  
> puts “hello”  
> end  
> freeze #this already exists and does what you want  
> end

Well, I’ll be damned. I didn’t know you could do that. You learn  
something knew every day I guess. 🙂

Doesn’t prevent subclassing though. 🙂

Thanks,

Dan

This communication is the property of Qwest and may contain confidential  
or  
privileged information. Unauthorized use of this communication is  
strictly  
prohibited and may be unlawful. If you have received this communication  
in error, please immediately notify the sender by reply e-mail and  
destroy  
all copies of the communication and any attachments.

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [May 11, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/re-final-closed-classes-in-ruby-was-sharp-knives-and-glue/94717/2 "2006-05-11T23:50:11Z")

</div>

On 5/11/06, Berger, Daniel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > def test  
> > Thanks,
> 
> Dan

But any solution you can put into place with pure ruby, can be  
circumvented  
just as easily. 🙂
