るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.210秒)
トップページ > 種類:インスタンスメソッド[x] > バージョン:2.2.0[x] > クエリ:a[x] > クエリ:-[x] > クエリ:n[x] > クエリ:append_features[x]

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. pop3 n_bytes
  3. pop n_bytes
  4. net/pop n_bytes
  5. pop3 n_mails

ライブラリ

クラス

検索結果

Module#append_features(module_or_class) -> self (91261.0)

モジュール(あるいはクラス)に self の機能を追加します。

モジュール(あるいはクラス)に self の機能を追加します。

このメソッドは Module#include の実体であり、
include を Ruby で書くと以下のように定義できます。

//emlist[例][ruby]{
def include(*modules)
modules.reverse_each do |mod|
# append_features や included はプライベートメソッドなので
# 直接 mod.append_features(self) などとは書けない
mod.__send__(:append_features, s...

Module#included(class_or_module) -> () (18922.0)

self が Module#include されたときに対象のクラスまたはモジュー ルを引数にしてインタプリタがこのメソッドを呼び出します。

self が Module#include されたときに対象のクラスまたはモジュー
ルを引数にしてインタプリタがこのメソッドを呼び出します。

@param class_or_module Module#include を実行したオブジェクト

//emlist[例][ruby]{
module Foo
def self.included(mod)
p "#{mod} include #{self}"
end
end
class Bar
include Foo
end
# => "Bar include Foo"
//}

@see Module#append_featu...