るりまサーチ

最速Rubyリファレンスマニュアル検索!
848件ヒット [801-848件を表示] (0.131秒)
トップページ > クエリ:t[x] > クエリ:Ruby[x] > 種類:インスタンスメソッド[x] > クエリ:@[x] > クラス:Module[x]

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

検索結果

<< < ... 7 8 9 >>

Module#<(other) -> bool | nil (120.0)

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

...other の子孫である場合、 true を返します。
self が other の先祖か同一のクラス/モジュールである場合、false を返します。

継承関係にないクラス同士の比較では
nil を返します。

@
param other 比較対象のモジュールやクラス

@
r...
...aise TypeError other がクラスやモジュールではない場合に発生します。

//emlist[例][ruby]{
module
Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo # => true
p Baz < Bar # => true
p Baz < Foo # => true
p Baz < Qux # => nil
p Baz >...
...Qux # => nil

p Foo < Object.new # => in `<': compared with non class/module (TypeError)
//}...

Module#class_variables(inherit = true) -> [Symbol] (120.0)

クラス/モジュールに定義されているクラス変数の名前の配列を返します。

...

@
param inherit false を指定しない場合はスーパークラスやインクルードして
いるモジュールのクラス変数を含みます。

//emlist[例][ruby]{
class One
@
@var1 = 1
end
class Two < One
@
@var2 = 2
end
One.class_variables # => [:@@var1]
T
wo.cla...
...ss_variables # => [:@@var2, :@@var1]
T
wo.class_variables(false) # => [:@@var2]
//}

@
see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#constants...

Module#<=>(other) -> Integer | nil (114.0)

self と other の継承関係を比較します。

...self と other の継承関係を比較します。

self と other を比較して、
self が other の子孫であるとき -1、
同一のクラス/モジュールのとき 0、
self が other の先祖であるとき 1
を返します。

継承関係にないクラス同士の比較では
n...
...il を返します。

other がクラスやモジュールでなければ
nil を返します。

@
param other 比較対象のクラスやモジュール

//emlist[例][ruby]{
module
Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar #...
...=> -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil

p Baz <=> Object.new # => nil
//}...

Module#psych_yaml_as(tag) -> () (114.0)

クラスと tag の間を関連付けます。

... tag の間を関連付けます。

これによって tag 付けされた YAML ドキュメントを Ruby のオブジェクトに
変換したりその逆をしたりすることができます。

この method は deprecated です。 Object.yaml_tag を
かわりに使ってください。

@
p...
...aram tag 対象のクラスに関連付けるタグの文字列...

Module#yaml_as(tag) -> () (114.0)

クラスと tag の間を関連付けます。

... tag の間を関連付けます。

これによって tag 付けされた YAML ドキュメントを Ruby のオブジェクトに
変換したりその逆をしたりすることができます。

この method は deprecated です。 Object.yaml_tag を
かわりに使ってください。

@
p...
...aram tag 対象のクラスに関連付けるタグの文字列...

絞り込み条件を変える

Module#freeze -> self (20.0)

モジュールを凍結(内容の変更を禁止)します。

...

凍結したモジュールにメソッドの追加など何らかの変更を加えようとした場合に
FrozenError
が発生します。

@
see Object#freeze

//emlist[例][ruby]{
module
Foo; end
Foo.freeze

module
Foo
def foo; end
end # => FrozenError: can't modify frozen module
//}...
<< < ... 7 8 9 >>