Ruby 3.3 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Moduleクラス > append_features (private)
append_features(module_or_class) -> self
[permalink][rdoc]モジュール(あるいはクラス)に self の機能を追加します。
このメソッドは Module#include の実体であり、 include を Ruby で書くと以下のように定義できます。
def include(*modules)
modules.reverse_each do |mod|
# append_features や included はプライベートメソッドなので
# 直接 mod.append_features(self) などとは書けない
mod.__send__(:append_features, self)
mod.__send__(:included, self)
end
end
[SEE_ALSO] Module#included