Skip to content
Permalink
Browse files

Merge pull request #726 from jstepien/define_singleton_method

Module#define_singleton_method
  • Loading branch information
alex committed May 23, 2013
2 parents 75c2f26 + 39bca0b commit e4b143f0e1518e089fdc06f6f2d0cd5dd4c05f6a
Showing with 8 additions and 1 deletion.
  1. +0 −1 spec/tags/core/module/define_singleton_method_tags.txt
  2. +8 −0 topaz/objects/moduleobject.py

This file was deleted.

@@ -398,9 +398,17 @@ def method_append_features(self, space, w_mod):
for module in reversed(self.ancestors()):
w_mod.include_module(space, module)

@classdef.method("define_singleton_method", name="symbol")
@check_frozen()
def method_define_singleton_method(self, space, name, w_method=None, block=None):
return self.klass.create_and_define_method(space, name, w_method, block)

@classdef.method("define_method", name="symbol")
@check_frozen()
def method_define_method(self, space, name, w_method=None, block=None):
return self.create_and_define_method(space, name, w_method, block)

def create_and_define_method(self, space, name, w_method=None, block=None):
if w_method is not None:
if space.is_kind_of(w_method, space.w_method):
w_method = space.send(w_method, "unbind")

0 comments on commit e4b143f

Please sign in to comment.