Skip to content
Browse files

1.8.7: Binding#eval (new)

  • Loading branch information...
1 parent c5b9450 commit 4cbf1e7b6ad18b6070fcc2a405edc2c13953f005 @marcandre marcandre committed May 7, 2009
Showing with 9 additions and 0 deletions.
  1. +1 −0 lib/1.8.7.rb
  2. +8 −0 lib/1.8.7/binding.rb
View
1 lib/1.8.7.rb
@@ -3,6 +3,7 @@
require 'enumerator'
require '1.8.7/array'
+require '1.8.7/binding'
require '1.8.7/enumerable'
require '1.8.7/enumerator'
View
8 lib/1.8.7/binding.rb
@@ -0,0 +1,8 @@
+class Binding
+ # Evaluates the Ruby expression(s) in string, in the binding‘s context.
+ # If the optional filename and lineno parameters are present,
+ # they will be used when reporting syntax errors.
+ def eval(expr, *arg)
+ Kernel.eval(expr, self, *arg)
+ end
+end

0 comments on commit 4cbf1e7

Please sign in to comment.
Something went wrong with that request. Please try again.