aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/proc.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-06-13 01:01:42 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2009-06-12 16:14:06 -0700
commitd32965399ccfa2052a4d52b70db1bae0ca16830b (patch)
tree7f41b1846efd2d11d7ebff15a115cba02ad75f11 /activesupport/lib/active_support/core_ext/proc.rb
parent54a5446641e4386285231385700b95a223931bff (diff)
downloadrails-d32965399ccfa2052a4d52b70db1bae0ca16830b.tar.gz
rails-d32965399ccfa2052a4d52b70db1bae0ca16830b.tar.bz2
rails-d32965399ccfa2052a4d52b70db1bae0ca16830b.zip
uses Object#metaclass and Object#class_eval in a few spots
[#2797 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib/active_support/core_ext/proc.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/proc.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/proc.rb b/activesupport/lib/active_support/core_ext/proc.rb
index 5c29cc32a2..572fc5f92c 100644
--- a/activesupport/lib/active_support/core_ext/proc.rb
+++ b/activesupport/lib/active_support/core_ext/proc.rb
@@ -1,7 +1,7 @@
class Proc #:nodoc:
def bind(object)
block, time = self, Time.now
- (class << object; self end).class_eval do
+ object.class_eval do
method_name = "__bind_#{time.to_i}_#{time.usec}"
define_method(method_name, &block) # define_method("__bind_1230458026_720454", &block)
method = instance_method(method_name) # method = instance_method("__bind_1230458026_720454")