# Re: How to find out object type

**URL:** <https://www.ruby-forum.com/t/re-how-to-find-out-object-type/86145>\
**Category:** Ruby\
**Created:** [February 20, 2007, 6:34am UTC](https://www.ruby-forum.com/t/re-how-to-find-out-object-type/86145 "2007-02-20T06:34:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [February 20, 2007, 6:34am UTC](https://www.ruby-forum.com/t/re-how-to-find-out-object-type/86145/1 "2007-02-20T06:34:34Z")

</div>

Ah, that’s the ticket! Great thanks for the explanation!

----- Original Message ----  
From: Gary W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: ruby-talk ML [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Monday, February 19, 2007 9:11:45 PM  
Subject: Re: How to find out object type

On Feb 20, 2007, at 12:01 AM, Phy P. wrote:

> ah, thats better. So now for the real nubie question, I am lost as  
> to why this does not work:
> 
> irb(main):001:0\> o = 123  
> =\> 123  
> irb(main):002:0\> #{o} = Array.new  
> irb(main):003:0\* o.class  
> =\> Fixnum  
> irb(main):004:0\> #{o}.class

The #{} notation is only applicable inside a string: “#{o}”. The  
way you are using it make the line look like a comment.  
Everything after the # is simply discarded.

Maybe you are looking for something like:

a = 123  
b = [o]  
p b # [123]

Gary W.
