# Self.inspect in helper file

**URL:** <https://www.ruby-forum.com/t/self-inspect-in-helper-file/156696>\
**Category:** Rails\
**Created:** [January 1, 2009, 9:32am UTC](https://www.ruby-forum.com/t/self-inspect-in-helper-file/156696 "2009-01-01T09:32:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 1, 2009, 9:32am UTC](https://www.ruby-forum.com/t/self-inspect-in-helper-file/156696/1 "2009-01-01T09:32:31Z")

</div>

Hi  
I just noticed this When i tried

puts self.inspect just in the module ApplicationHelper gives  
ApplicationHelper

And if i place the above puts statement in any def in the helper module,  
then it prints like

#\<ActionView::Base:0xb67a6be0 @first\_render=“home/index”,  
@content\_for\_layout="\<div class="ho…etc

```
        I did not understand the difference .Could you please

```

explain this?

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 1, 2009, 10:05am UTC](https://www.ruby-forum.com/t/self-inspect-in-helper-file/156696/2 "2009-01-01T10:05:37Z")

</div>

On 1 Jan 2009, at 08:32, Sijo Kg [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> #\<ActionView::Base:0xb67a6be0 @first\_render=“home/index”,  
> @content\_for\_layout="\<div class="ho…etc
> 
> ```
> I did not understand the difference .Could you please
> 
> ```
> 
> explain this?

Because those two statements run at very different times. Once when  
the module is being defined (self is the module) the second runs when  
one of the instance methods runs in which case self is the object in  
question.

Fred

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 1, 2009, 12:02pm UTC](https://www.ruby-forum.com/t/self-inspect-in-helper-file/156696/3 "2009-01-01T12:02:25Z")

</div>

Hi  
Thanks for your reply  
Sijo
