るりまサーチ

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

別のキーワード

  1. module prepended
  2. _builtin prepended
  3. prepended module
  4. prepended _builtin

ライブラリ

クラス

モジュール

キーワード

検索結果

Module#prepended(class_or_module) -> () (18119.0)

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

...r_module Module#prepend を実行したオブジェクト

//emlist[例][ruby]{
module A
def self.prepended(mod)
puts "#{self} prepended to #{mod}"
end
end
module Enumerable
prepend A
end
# => "A prepended to Enumerable"
//}

@see Module#included, Module#prepend, Module#prepend_features...
...or_module Module#prepend を実行したオブジェクト

//emlist[例][ruby]{
module A
def self.prepended(mod)
puts "#{self} prepended to #{mod}"
end
end
module Enumerable
prepend A
end
# => "A prepended to Enumerable"
//}

@see Module#included, Module#prepend, Module#prepend_features...

Module#>(other) -> bool | nil (30.0)

比較演算子。 self が other の先祖である場合、true を返します。 self が other の子孫か同一クラスである場合、false を返します。

...e Included
include Awesome
end
module Prepended
prepend Awesome
end

Included.ancestors # => [Included, Awesome]
Awesome > Included # => true
Included > Awesome # => false

Prepended
.ancestors # => [Awesome, Prepended]
Awesome > Prepended # => true
Prepended
> Awesome # => false

Awesome > Aweso...

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (16.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

...If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+
name, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative inte...

Kernel#check_signedness(type, headers = nil, opts = nil) { ... } -> "signed" | "unsigned" | nil (16.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

...If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+
name, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative inte...

NEWS for Ruby 3.0.0 (12.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...odule#prepend now affect classes and modules that have already included or prepended the receiver, mirroring the behavior if the arguments were included in the receiver before the other modules and classes included or prepended the receiver. 9573
* Module#public, Module#protected, Module#private...

絞り込み条件を変える

Module#prepend(*modules) -> self (6.0)

指定したモジュールを self の継承チェインの先頭に「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。

...prepend の処理を追加/変更できます。


@param modules prepend する Module を指定します
@see Module#prepend_features, Module#prepended

//emlist[例][ruby]{
# super と prepend の組み合わせの例
module X
def foo
puts "X1" # (1x)
super # (2x)
puts "X2" # (3x)...

Module#prepend_features(mod) -> self (6.0)

Module#prepend から呼び出されるメソッドで、 prepend の処理の実体です。このメソッド自体は mod で指定した モジュール/クラスの継承チェインの先頭に self を追加します。

...れます

//emlist[例][ruby]{
class Recorder
RECORDS = []
end

module X
def self.prepend_features(mod)
Recorder::RECORDS << mod
end
end

class A
prepend X
end

class B
include X
end

class C
prepend X
end

Recorder::RECORDS # => [A, C]
//}

@see Module#prepend, Module#prepended...

NEWS for Ruby 2.0.0 (6.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...
「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。
* 追加: Module.prepended, Module.prepend_features は Module.included と Module.append_features に似ています
* 追加(実験的): Module#refine, スコープを...