# Zlib, hidden classes and modules

**URL:** <https://www.ruby-forum.com/t/zlib-hidden-classes-and-modules/126280>\
**Category:** Ruby\
**Created:** [January 16, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/zlib-hidden-classes-and-modules/126280 "2008-01-16T23:31:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kryptonator](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/dfb087/32.png) [@kryptonator](https://www.ruby-forum.com/u/kryptonator)\
**Post date:** [January 16, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/zlib-hidden-classes-and-modules/126280/1 "2008-01-16T23:31:28Z")

</div>

Hello, I am pretty new to ruby although I am a quick learner and have  
the benefit of help from a pretty experienced scripter, however with my  
tutor being abscent from the forum and IRC channels I think maybe it’s  
time I started to join a specific forum regarding coding only.

As my first question I would like some help with Zlib (Inflate.inflate +  
Defalte.deflate) here is a little snippet of code my tutor gave me a  
while ago.

Dir.mkdir("./script") unless File.exist?("./script")  
$RGSS\_SCRIPTS.each do |s|  
s[1] = s[1].gsub(/::/,"_").gsub(///, "_")  
s[2] = Zlib::Inflate.inflate(s[2])  
File.open("./script/#{s[1]}.rb",“wb”) do |f|  
f.print(s[0])  
end  
end

What this does is it saves all scripts in my program to a new folder in  
my project folder called scripts and it outputs them from a data file  
into .rb files allowing me to edit the code with notpad++ instead of  
using the built in script editor, now this is good however there are  
hidden classes and modules that I desperately need to edit as they fall  
short of the standard that I should expect, but they are’nt outputed  
with the above.

So I did a test to see if the hidden classes and modules are included in  
the ruby heap.

ObjectSpace::each\_object(Class){|x|  
p x  
}

Which printed to screen all the usual Zlib, hash, array and also all the  
classes I can edit within the editor and listed all the hidden classes  
and modules, so my theory is they are contained in the editor and not a  
seperate file, I can also with the Zlib code above print to screen about  
20 lines of a classes code, but again the hidden classes are well,  
hidden, I would like to know if there would be a way.

Is there a way to view hidden classes and modules code, also is it  
possible to print to screen more than about 20 lines of a classes code.
