# Viewing code

**URL:** <https://www.ruby-forum.com/t/viewing-code/125310>\
**Category:** Ruby\
**Created:** [January 8, 2008, 4:46am UTC](https://www.ruby-forum.com/t/viewing-code/125310 "2008-01-08T04:46:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fussy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/dbc845/32.png) [@fussy](https://www.ruby-forum.com/u/fussy)\
**Post date:** [January 8, 2008, 4:46am UTC](https://www.ruby-forum.com/t/viewing-code/125310/1 "2008-01-08T04:46:20Z")

</div>

I am new to ruby and although I am learning quickley I was wondering if  
it is possible to view code, I will explain.

# When I write a module I can use the below code to print out the method names I used in my module on screen which is ok, but is it possible to print everything I written (the whole script) onscreen and/or output/save it to a txt file?

# module Hidden class \<\< self p instance\_methods-Module.instance\_methods end end

---

<div class="post-metadata">

**Author:** ![fussy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/dbc845/32.png) [@fussy](https://www.ruby-forum.com/u/fussy)\
**Post date:** [January 8, 2008, 4:34pm UTC](https://www.ruby-forum.com/t/viewing-code/125310/2 "2008-01-08T16:34:56Z")

</div>

Ok I found a better way of explaining it.

Say I write a module for a program and I implement it and it all works  
fine but later I want to add onto it but I can no longer remember what I  
written in and the module itself is not visible within the program.

When I use the above code in my first post it returns the methods I  
wrote in arrays but nothing else, then the program continues as normal  
this isn’t too bad as it helps me remember what methods I used, but, I  
still need to know everything else so instead of taking ages deciphering  
and remembering what else I wrote is it possible to print to screen or  
output the whole script into a .txt document.

Problem is I didn’t make a copy of my module and now the module is there  
and working but I want to add to it without deciphering and without  
adding a new module with aliases.
