File.open('test.txt', 'w') {|f| f.write(doc) }
puts "yeah, it is done"
assert will terminate the program (usually with a message quoting the assert statement) if its argument turns out to be false. it's commonly used during debugging to make the program fail more obviously if an unexpected condition occurs.
for example:
assert(length >= 0); // die if length is negative.
Get the mothods of any object by using ".methods"
self.methods
#or
x = []
x.methods