diff --git a/activesupport/lib/binding_of_caller.rb b/activesupport/lib/binding_of_caller.rb index f58e87796cca50a0448e082dfee903f3d1a5fd24..759e76001632fafc18b722dd708cc2a460e4fcdb 100644 --- a/activesupport/lib/binding_of_caller.rb +++ b/activesupport/lib/binding_of_caller.rb @@ -2,7 +2,7 @@ require 'simplecc' rescue LoadError class Continuation #:nodoc: - def create(*args, &block) + def self.create(*args, &block) cc = nil; result = callcc {|c| cc = c; block.call(cc) if block and args.empty?} result ||= args return *[cc, *result] @@ -36,7 +36,7 @@ class Binding #:nodoc: # If you don't do this an Exception will be raised. Because of # the way that Binding.of_caller is implemented it has to be # done this way. - def of_caller(&block) + def self.of_caller(&block) old_critical = Thread.critical Thread.critical = true count = 0 diff --git a/railties/lib/binding_of_caller.rb b/railties/lib/binding_of_caller.rb index f58e87796cca50a0448e082dfee903f3d1a5fd24..759e76001632fafc18b722dd708cc2a460e4fcdb 100644 --- a/railties/lib/binding_of_caller.rb +++ b/railties/lib/binding_of_caller.rb @@ -2,7 +2,7 @@ require 'simplecc' rescue LoadError class Continuation #:nodoc: - def create(*args, &block) + def self.create(*args, &block) cc = nil; result = callcc {|c| cc = c; block.call(cc) if block and args.empty?} result ||= args return *[cc, *result] @@ -36,7 +36,7 @@ class Binding #:nodoc: # If you don't do this an Exception will be raised. Because of # the way that Binding.of_caller is implemented it has to be # done this way. - def of_caller(&block) + def self.of_caller(&block) old_critical = Thread.critical Thread.critical = true count = 0