Project

General

Profile

Backport #8881

Refinment doesn't update #methods

Added by minad (Daniel Mendler) about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:57080]

Description

=begin
Hi,

the refinements don't respect #methods. Consider the following:

Object.methods.include?(:foo) # returns false
Module.methods.include?(:foo) # returns false

module Test
refine Object do
def foo; end
end
end

puts Object.methods.include?(:foo)# returns true
puts Module.methods.include?(:foo)# returns true

Object.new.foo # Exception

Daniel Mendler
=end

Also available in: Atom PDF