Project

General

Profile

Actions

Feature #22484

closed

Object#undef_singleton_method and Object#remove_singleton_method

Feature #22484: Object#undef_singleton_method and Object#remove_singleton_method

Added by UlyssesZhan (Ulysses Zhan) about 1 month ago. Updated 9 days ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:127272]

Description

Equivalent to singleton_class.undef_method and singleton_class.remove_method.

Updated by matz (Yukihiro Matsumoto) 9 days ago Actions #1 [ruby-core:127616]

  • Status changed from Open to Rejected

My answer is the same as in #22473. obj.singleton_class.remove_method(:name) and obj.singleton_class.undef_method(:name) already do this clearly, and removing singleton methods is rare. I'd also like to be careful about adding methods to Object.

So I am not going to accept this proposal. If you have a concrete use case where the current way is really inconvenient, please describe it and we can reconsider.

Matz.

Actions

Also available in: PDF Atom