Method#owner returns wrong owner if using prepend

Issue #9526 has been updated by Kaneko Yuichiro.

Sorry, I misunderstood behavior of prepend. Shugo and Boris are right.
Thanks for your quick responce. Please close this ticket :slight_smile:

Bug #9526: Method#owner returns wrong owner if using prepend.

  • Author: Kaneko Yuichiro
  • Status: Feedback
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • ruby -v: ruby-2.0.0-p353 [ x86_64 ] & ruby-2.1.0 [ x86_64 ]
  • Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN

rdoc indicates that Method#owner will return a class or module that
defines a method.

module MyMod
def x(y)

class Blah
def x(y)
y + 1
prepend MyMod
# => MyMod

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs