# Origin of a definition

**URL:** <https://www.ruby-forum.com/t/origin-of-a-definition/142351>\
**Category:** Ruby\
**Created:** [July 7, 2008, 7:03am UTC](https://www.ruby-forum.com/t/origin-of-a-definition/142351 "2008-07-07T07:03:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/fbc32d/32.png) [@ole](https://www.ruby-forum.com/u/ole)\
**Post date:** [July 7, 2008, 7:03am UTC](https://www.ruby-forum.com/t/origin-of-a-definition/142351/1 "2008-07-07T07:03:59Z")

</div>

Is there any way to find out the filename and line number of a  
definition such as a class or method at runtime?

---

<div class="post-metadata">

**Author:** ![ole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/fbc32d/32.png) [@ole](https://www.ruby-forum.com/u/ole)\
**Post date:** [July 7, 2008, 3:40pm UTC](https://www.ruby-forum.com/t/origin-of-a-definition/142351/2 "2008-07-07T15:40:51Z")

</div>

On Jul 7, 1:00 am, Oliver S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## Is there any way to find out the filename and line number of a definition such as a class or method at runtime?
> 
> Posted viahttp://www.ruby-forum.com/.

I ran across this blog post once and bookmarked it, perhaps this will  
work for you.

[http://aaronbedra.com/2008/6/12/slight-of-hand-for-the-ruby-man](http://aaronbedra.com/2008/6/12/slight-of-hand-for-the-ruby-man)
