@toplevel_variate = "toplevel variate"
def my_method
"@toplevel_variate in my_method which define in toplevel:#{@toplevel_variate}"
end
Object.class_eval do |variable|
puts "Object can acccess @toplevel_variate:#{@var}"
end
self.instance_eval do
puts "@toplevel_variate in self object:#{@toplevel_variate}"
end
puts my_method
puts "Object.private_instance_methods:" + Object.private_instance_methods(false).grep(:my_method).to_s
puts "Object.instance_methods:" + Object.instance_methods(false).grep(:my_method).to_s