Created
February 4, 2011 02:40
-
-
Save carlosbrando/810656 to your computer and use it in GitHub Desktop.
Flat Scope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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