るりまサーチ

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

別のキーワード

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

検索結果

<< < 1 2 3 4 > >>

Module#<=(other) -> bool | nil (174.0)

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

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

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

@
param other 比較対象...
...

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

@
see Module#<

//emlist[例][ruby]{
module
Foo; end
module
Bar
include Foo
end
module
Baz
prepend Foo
end

Bar.ancestors # => [Bar, Foo]
Foo <= Bar # => false
Bar <= Foo # => true

Baz.ancestors #...
...=> [Foo, Baz]
Foo <= Baz # => false
Baz <= Foo # => true

Foo <= Foo # => true
Foo <= Object # => nil
//}...

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

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

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

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

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

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

@
see Module#<

//emlist[例][ruby]{
module
Awesome; end
module
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 > Awesome # => false
Awesome > Object # => nil
//}...

Module#>=(other) -> bool | nil (158.0)

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

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

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

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

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

@
see Module#<

//emlist[例][ruby]{
module
Foo; end
module
Bar
include Foo
end
module
Baz
prepend Foo
end

Bar.ancestors # => [Bar, Foo]
Foo >= Bar # => true
Bar >= Foo # => false

Baz.ancestors # => [Foo, Baz]
Fo...
...o >= Baz # => true
Baz >= Foo # => false

Foo >= Foo # => true
Foo >= Object # => nil
//}...

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

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

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

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

@
param other 比較対象のモ...
...ルやクラス

@
raise 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#<=>(other) -> Integer | nil (148.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#class_eval {|mod| ... } -> object (144.0)

モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。

...トで評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。

ただし、ローカル変数は module_eval/class_eval の外側のスコープと共有します。...
...ます。


@
param expr 評価される文字列。

@
param fname 文字列を指定します。ファイル fname に文字列 expr が書かれているかのように実行されます。
スタックトレースの表示などを差し替えることができます。

@
param lineno...
...ことができます。

//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m # メソッドを動的に定義できる。
return :m, #{a}
end
}

p C.new.m #=> [:m, 1]
//}

//emlist[定数のスコープが異なる例][ruby]{
class C
end

# ブロックが...

Module#class_eval(expr, fname = "(eval)", lineno = 1) -> object (144.0)

モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。

...トで評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。

ただし、ローカル変数は module_eval/class_eval の外側のスコープと共有します。...
...ます。


@
param expr 評価される文字列。

@
param fname 文字列を指定します。ファイル fname に文字列 expr が書かれているかのように実行されます。
スタックトレースの表示などを差し替えることができます。

@
param lineno...
...ことができます。

//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m # メソッドを動的に定義できる。
return :m, #{a}
end
}

p C.new.m #=> [:m, 1]
//}

//emlist[定数のスコープが異なる例][ruby]{
class C
end

# ブロックが...

Module#class_exec(*args) {|*vars| ... } -> object (144.0)

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

...のモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。

ローカル変数、定数とクラス変数のスコープはブロックの外側のスコープになります。

@
param args ブロッ...
...ist[例][ruby]{
class Thing
end
c = 1

T
hing.class_exec{
def hello()
"Hello there!"
end

define_method(:foo) do # ローカル変数がブロックの外側を参照している
c
end
}

t
= Thing.new
p t.hello() #=> "Hello there!"
p t.foo() #=> 1
//}

@
se...
...e Module#module_eval, Module#class_eval...

Module#module_eval {|mod| ... } -> object (144.0)

モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。

...トで評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。

ただし、ローカル変数は module_eval/class_eval の外側のスコープと共有します。...
...ます。


@
param expr 評価される文字列。

@
param fname 文字列を指定します。ファイル fname に文字列 expr が書かれているかのように実行されます。
スタックトレースの表示などを差し替えることができます。

@
param lineno...
...ことができます。

//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m # メソッドを動的に定義できる。
return :m, #{a}
end
}

p C.new.m #=> [:m, 1]
//}

//emlist[定数のスコープが異なる例][ruby]{
class C
end

# ブロックが...
<< < 1 2 3 4 > >>