#conceptual questions abound
class Bar
def show_hidden
x = "Yikes! Where did I come from? Is 'y' really an instance?"
puts x
end
puts "\n"
puts "This is my 'self': #{self}\n"
puts "Why does 'self' only print once?\nWhy not when I create the 'y'
object?\n\n"
end #class Bar
class Foo
what_am_i = "If no instance of class Foo exists, why is this printing?\n"
puts what_am_i
puts "what is the section of code outside any 'def' called?\n"
puts "If no instance of Foo exists, what is creating this Bar instance?\n"
y = Bar.new
y.show_hidden
end #class Foo
z = "\nJust can call me 'z'\n"
puts z
puts z.type
puts "What about z? It is inside a class?\n\n"
# thanks
# doug edmunds
# 18 Mar 2001