From: naruse@... Date: 2015-02-14T03:22:56+00:00 Subject: [ruby-dev:48867] [Ruby trunk - Bug #10826] Refinements make instance_methods(false) return methods of superclasses Issue #10826 has been updated by Yui NARUSE. Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE ruby_2_2 r49592 merged revision(s) 49493. ---------------------------------------- Bug #10826: Refinements make instance_methods(false) return methods of superclasses https://bugs.ruby-lang.org/issues/10826#change-51500 * Author: Shugo Maeda * Status: Closed * Priority: Normal * Assignee: Shugo Maeda * ruby -v: ruby 2.3.0dev (2015-02-04 trunk 49489) [x86_64-linux] * Backport: 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE ---------------------------------------- If a method is refined for a subclass X of the owner of the method, X.instance_methods(false) returns that method even if it's not defined in X. ```ruby class X def foo end end class Y < X end module Bar refine Y do def foo end end end p Y.instance_methods(false).include?(:foo) # false expected, but true is returned ``` -- https://bugs.ruby-lang.org/