 <p>Sure. You can use the magic constant <code>__FILE__</code> which contains the path to the file that you use it in:</p> <pre><code>class MyClass def initialize puts File.read(__FILE__) end end </code></pre> <p>This will print the contents of the file containing the definition of <code>MyClass</code> every time you create a <code>MyClass</code> object.</p>