るりまサーチ

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

別のキーワード

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

検索結果

<< < ... 6 7 8 9 > >>

Module#<(other) -> bool | nil (144.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#<=(other) -> bool | nil (144.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 (144.0)

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

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

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

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

@
raise TypeError 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]
Aweso...
...me > Prepended # => true
Prepended > Awesome # => false

Awesome > Awesome # => false
Awesome > Object # => nil
//}...

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

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

...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 # => true
Bar >= Foo # => false

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

Foo >= Foo # => true
Foo >= Object #...

Module#<=>(other) -> Integer | nil (138.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#public(name) -> String | Symbol (138.0)

メソッドを public に設定します。

...it を参照して下さい。

@
param name 0 個以上の String または Symbol を指定します。
@
param names 0 個以上の String または Symbol を Array で指定します。

@
raise NameError 存在しないメソッド名を指定した場合に発生します。

//emlist[例][ruby...
...]{
def foo() 1 end
p foo # => 1
# the toplevel default is private
p self.foo # => private method `foo' called for #<Object:0x401c83b0> (NoMethodError)

def bar() 2 end
public :bar # visibility changed (all access allowed)
p bar # => 2
p self.bar # => 2
//}...

Module#remove_class_variable(name) -> object (138.0)

引数で指定したクラス変数を取り除き、そのクラス変数に設定さ れていた値を返します。

...、そのクラス変数に設定さ
れていた値を返します。

@
param name String または Symbol を指定します。

@
return 引数で指定されたクラス変数に設定されていた値を返します。

@
raise NameError 引数で指定されたクラス変数がそのモジュ...
...ールやクラスに定義されていない場合に発生します。

//emlist[例][ruby]{
class Foo
@
@foo = 1
remove_class_variable(:@@foo) # => 1
p @@foo # => uninitialized class variable @@foo in Foo (NameError)
end

//}

@
see Module#remove_const, Object#remove_instance_variable...

Module#class_variables(inherit = true) -> [Symbol] (132.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#freeze -> self (38.0)

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

...

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

@
see Object#freeze

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

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