るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.025秒)
トップページ > クラス:Module[x] > クエリ:included[x] > クエリ:append_features[x]

別のキーワード

  1. rake append
  2. mutex_m append_features
  3. fcntl o_append
  4. invocationchain append
  5. readline completion_append_character

ライブラリ

検索結果

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

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

... Module#include の実体であり、
include を Ruby で書くと以下のように定義できます。

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

@see Module#included...

Module#included(class_or_module) -> () (18114.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_features...