Forum: Ruby-core Refinment doesn't update #methods

768c4401e9e8dc378a841955a7df728a?d=identicon&s=25 Daniel Mendler (Guest)
on 2013-09-09 04:21
(Received via mailing list)
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
768c4401e9e8dc378a841955a7df728a?d=identicon&s=25 Daniel Mendler (Guest)
on 2013-09-09 04:29
(Received via mailing list)
This happens only for Object, not for other classes. The version is ruby
2.1.0dev (2013-09-08) [x86_64-linux]
This topic is locked and can not be replied to.