Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/module.rb
Original file line number Diff line number Diff line change
@@ -442,7 +442,11 @@ def define_method(name, meth = undefined, &prc)

name = Rubinius::Type.coerce_to_symbol name

code, scope = meth.for_define_method(name, self.class)
if meth.respond_to?(:for_define_method)
code, scope = meth.for_define_method(name, self.class)
else
raise TypeError, "wrong argument type #{meth.class} (expected Proc/Method)"
end

Rubinius.add_method name, code, self, scope, 0, :public

0 comments on commit 510919d

Please sign in to comment.