るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.037秒)
トップページ > ライブラリ:ビルトイン[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 (18121.0)

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

...uby]{
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 Mod...

Class (8.0)

クラスのクラスです。

...すが、それ以外のほとんどの機能は Module から継
承されています。Module のメソッドのうち

* Module#module_function
* Module#extend_object
* Module#append_features
* Module#prepend_features
* Module#refine

は Class では未定義にされています。...

Module#include(*mod) -> self (8.0)

モジュール mod をインクルードします。

...合に発生します。

//emlist[例][ruby]{
module M
end
module M2
include M
end
module M
include M2
end
//}

実行結果:

-:3:in `append_features': cyclic include detected (ArgumentError)
from -:3:in `include'
from -:3


インクルードとは、指定されたモ...

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

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...