Created
November 2, 2012 14:58
-
-
Save joannecheng/4001852 to your computer and use it in GitHub Desktop.
Ruby Bindings
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
class SampleClass | |
def initialize | |
@str = "The Quick Brown Fox" | |
end | |
def get_binding | |
binding | |
end | |
end | |
eval("puts @str", SampleClass.new.get_binding) | |
# => "The Quick Brown Fox" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment