# TrueClass === TrueClass

**URL:** <https://www.ruby-forum.com/t/trueclass-trueclass/82703>\
**Category:** Ruby\
**Created:** [January 19, 2007, 9:00pm UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703 "2007-01-19T21:00:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [January 19, 2007, 9:00pm UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703/1 "2007-01-19T21:00:54Z")

</div>

Hi all,  
why is:

TrueClass === TrueClass # false  
Object === Object # true

Documentation states that === method is used to provide meaningful  
semantic in case statements. Can anyone explain me why some classes  
returns false?

thnx,  
Bojan M.

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [January 19, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703/2 "2007-01-19T21:06:55Z")

</div>

Bojan M. wrote:

> Hi all,  
> why is:
> 
> TrueClass === TrueClass # false  
> Object === Object # true
> 
> Documentation states that === method is used to provide meaningful  
> semantic in case statements. Can anyone explain me why some classes  
> returns false?

=== returns true with one class if you ‘compare’ it to an instance of  
the class:

irb(main):002:0\> TrueClass == TrueClass  
=\> true  
irb(main):003:0\> TrueClass === TrueClass  
=\> false  
irb(main):004:0\> TrueClass === true  
=\> true

Cheers,

Vince

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [January 19, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703/3 "2007-01-19T21:57:01Z")

</div>

Vincent F. wrote:

> Cheers,
> 
> Vince

Thanx Vince, just what I looked for.  
Bojan

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [January 19, 2007, 9:16pm UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703/4 "2007-01-19T21:16:57Z")

</div>

On 1/19/07, Vincent F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Cheers,  
> Ah - so Object === Object returns true because the second Object is an  
> instance of the first Object. How deceiving.

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [January 20, 2007, 6:10pm UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703/5 "2007-01-20T18:10:53Z")

</div>

On 1/19/07, David C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > semantic in case statements. Can anyone explain me why some classes  
> > > =\> true
> > 
> > Cheers,
> 
> Ah - so Object === Object returns true because the second Object is an  
> instance of the first Object. How deceiving.

If you are looking for a language in which not everything is an object,  
there are plenty around 😉

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [January 21, 2007, 10:15am UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703/6 "2007-01-21T10:15:34Z")

</div>

On 1/20/07, David C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > > Object === Object # true  
> > > > > irb(main):002:0\> TrueClass == TrueClass
> > 
> > If you are looking for a language in which not everything is an object,  
> > there are plenty around 😉
> 
> Oh, you misunderstand. Let me rephrase:
> 
> “How deliciously deceiving.”

I was not sure, but I thought that if you really did not realize what  
was  
going on I might give a hint 😉  
But of course you were, sorry for the noise.

Robert

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [January 20, 2007, 8:46pm UTC](https://www.ruby-forum.com/t/trueclass-trueclass/82703/7 "2007-01-20T20:46:22Z")

</div>

On 1/20/07, Robert D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > Documentation states that === method is used to provide meaningful  
> > > > irb(main):004:0\> TrueClass === true  
> > > > =\> true
> > > 
> > > Cheers,
> > 
> > Ah - so Object === Object returns true because the second Object is an  
> > instance of the first Object. How deceiving.
> 
> If you are looking for a language in which not everything is an object,  
> there are plenty around 😉

Oh, you misunderstand. Let me rephrase:

“How deliciously deceiving.”
