[ruby-core:127272] [Ruby Feature#22484] Object#undef_singleton_method and Object#remove_singleton_method
Issue #22484 has been reported by UlyssesZhan (Ulysses Zhan). ---------------------------------------- Feature #22484: Object#undef_singleton_method and Object#remove_singleton_method https://bugs.ruby-lang.org/issues/22484 * Author: UlyssesZhan (Ulysses Zhan) * Status: Open ---------------------------------------- Equivalent to `singleton_class.undef_method` and `singleton_class.remove_method`. -- https://bugs.ruby-lang.org/
Issue #22484 has been updated by matz (Yukihiro Matsumoto). 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. ---------------------------------------- Feature #22484: Object#undef_singleton_method and Object#remove_singleton_method https://bugs.ruby-lang.org/issues/22484#change-120135 * Author: UlyssesZhan (Ulysses Zhan) * Status: Rejected ---------------------------------------- Equivalent to `singleton_class.undef_method` and `singleton_class.remove_method`. -- https://bugs.ruby-lang.org/
participants (2)
-
matz (Yukihiro Matsumoto) -
UlyssesZhan (Ulysses Zhan)