るりまサーチ

最速Rubyリファレンスマニュアル検索!
72件ヒット [1-72件を表示] (0.025秒)
トップページ > クエリ:end[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 (24231.0)

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

...ude(*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 Module#included...

Mutex_m.append_features(klass) -> Class | nil (24207.0)

ユーザが直接、使うことはありません。

...ユーザが直接、使うことはありません。

@see Module#append_features...

static VALUE rb_mod_append_features(VALUE module, VALUE include) (12200.0)

ruby 1.6 feature (306.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ーになっていました。
((<ruby-dev:17155>))

open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end

}

=> ruby 1.6.7 (2002-03-01) [i586-linux]
-:3:in `close_write': closing non-duplex IO for writing (IOError)
from -:3...
...トで 2 回シグナルを送らないと終了しない不具合が修正さ
れました。((<ruby-bugs-ja:PR#223>))

trap(:TERM, "EXIT")

END
{
puts "exit"
}

Thread.start { Thread.stop }
sleep

: 2002-04-17: Regexp#inspect

((<ruby-bugs-ja:PR#222>))

p %r{\/}...
...れないようになりました。

module Foo; end
module Bar; include Foo; end
module Foo; include Bar; end

p Foo.ancestors

=> ruby 1.6.6 (2001-12-26) [i586-linux]
[Foo, Bar, Foo]

=> -:3:in `append_features': cyclic include detected (ArgumentError)
f...

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

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

...しまうような include を行った場合に発生します。

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


...
...は多重継承の代わりに用いられており、 mix-in とも呼びます。

//emlist[例][ruby]{
class C
include FileTest
include Math
end


p C.ancestors

# => [C, Math, FileTest, Object, Kernel]
//}

モジュールの機能追加は、クラスの継承関係の間にそのモジュ...
...二回以上 include すると二回目以降は無視されます。

//emlist[例][ruby]{
module M
end

class C1
include M
end

class C2 < C1
include M # この include は無視される
end


p C2.ancestors # => [C2, C1, M, Object, Kernel]
//}

引数に複数のモジュールを指定し...

絞り込み条件を変える

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