Permalink
Browse files

fixes class method issue.

  • Loading branch information...
1 parent 3267673 commit 96d00dbd712b6d5b015533a40734097bf0cbce10 @ono ono committed Oct 22, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/rr/injections/double_injection.rb
@@ -108,10 +108,11 @@ def bind_method_with_alias
end
def bind_method
+ subject = @subject.is_a?(Class) && !@subject.name.empty? ? @subject.name : "self"
returns_method = <<-METHOD
def #{@method_name}(*args, &block)
arguments = MethodArguments.new(args, block)
- RR::Space.double_injection(self, :#{@method_name}).dispatch_method(arguments.arguments, arguments.block)
+ RR::Space.double_injection(#{subject}, :#{@method_name}).dispatch_method(arguments.arguments, arguments.block)
end
METHOD
subject_class.class_eval(returns_method, __FILE__, __LINE__ - 5)

0 comments on commit 96d00db

Please sign in to comment.