Skip to content

Instantly share code, notes, and snippets.

@carlosbrando
Created February 4, 2011 02:40
Show Gist options
  • Save carlosbrando/810656 to your computer and use it in GitHub Desktop.
Save carlosbrando/810656 to your computer and use it in GitHub Desktop.
Flat Scope
my_var = "Success"
MyClass = Class.new do
puts "#{my_var} in the class definition!"
define_method :my_method do
puts "#{my_var} in the method!"
end
end
MyClass.new.my_method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment