https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-12-26T06:47:42ZRuby Issue Tracking SystemBackport191 - Backport #5807: "define_method" not consistent with "def"https://bugs.ruby-lang.org/issues/5807?journal_id=229602011-12-26T06:47:42Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>=begin<br>
These two are different things.</p>
<p>def foo1<br>
puts "foo1 called"<br>
end</p>
<p>class << self<br>
define_method(:foo2) do<br>
puts "foo2 called"<br>
end<br>
end</p>
<p>While (({foo1})) is a private instance method of (({Object})), (({foo2})) is a singleton method of (({main})).<br>
=end</p>