Created
June 2, 2012 18:52
-
-
Save offby1/2859586 to your computer and use it in GitHub Desktop.
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
data = 3 | |
def gimme_that_data | |
data | |
end | |
p data | |
# in `gimme_that_data': undefined local variable or method `data' for main:Object (NameError) | |
#p gimme_that_data | |
pleeze_gimme = lambda do | |
data | |
end | |
p pleeze_gimme.call | |
def more_gimmie(&block) | |
yield | |
end | |
p more_gimmie { data } | |
self.class.send(:define_method, :ooh_this_works) do | |
data | |
end | |
p ooh_this_works | |
define_singleton_method(:this_too) { data } | |
p this_too |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment