2015-09-25から1日間の記事一覧

Ruby でクラスが継承したクラスや include したモジュールの優先順位を調べる

クラスが継承したクラスや include したモジュールの優先順位は Module#ancestors で調べることができます。 module IncludedModule end module PrependedModule end class Super end class X < Super include IncludedModule prepend PrependedModule end X…