0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ruby2.0で__callee__が変わったけどsuperは変化無いよねという

Posted at
$VERBOSE = true

class Super
  def foo
    :super_foo
  end

  def bar
    :super_bar
  end
end

class Sub < Super
  def foo
    p __callee__ #=> :bar
    p __method__ #=> :foo
    p super      #=> :super_foo
  end

  alias_method :bar, :foo
end

Sub.new.bar

:super_bar 返しそうな気がふっとしたので、一応確認しておいた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?