Skip to content

Commit

Permalink
Revert "closes celluloid#563 until 0.18.0 or later"
Browse files Browse the repository at this point in the history
This reverts commit b35bf18.

Conflicts:
	lib/celluloid/calls.rb
  • Loading branch information
e2 committed Apr 21, 2015
1 parent edd15ad commit 1c41822
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions lib/celluloid/calls.rb
Expand Up @@ -22,7 +22,6 @@ def execute_block_on_receiver
end

def dispatch(obj)
check(obj)
_b = @block && @block.to_proc
obj.public_send(@method, *@arguments, &_b)
=begin
Expand All @@ -34,26 +33,6 @@ def dispatch(obj)
retry
=end
end

def check(obj)
# NOTE: don't use respond_to? here
begin
meth = obj.method(@method)
rescue NameError
raise NoMethodError, "undefined method `#{@method}' for #<#{obj.class}:0x#{obj.object_id.to_s(16)}>"
end

arity = meth.arity

if arity >= 0
raise ArgumentError, "wrong number of arguments (#{@arguments.size} for #{arity})" if @arguments.size != arity
elsif arity < -1
mandatory_args = -arity - 1
raise ArgumentError, "wrong number of arguments (#{@arguments.size} for #{mandatory_args}+)" if arguments.size < mandatory_args
end
rescue => ex
raise AbortError.new(ex)
end
end
end

Expand Down

0 comments on commit 1c41822

Please sign in to comment.