Created
April 25, 2016 15:36
-
-
Save clausd/f30d6cfe7f9044d755dfe3310ff4fb61 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 IntrospectBinding | |
attr_accessor :binding, :evals | |
def initialize(binding) | |
@binding = binding | |
@evals = [] | |
end | |
def eval(string, filename = '', lineno = 0) | |
@evals.push([string, filename, lineno]) | |
binding.eval(string, filename, lineno) | |
end | |
def method_missing(method_sym, *arguments, &block) | |
binding.send(method_sym, *arguments, &block) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment