るりまサーチ

最速Rubyリファレンスマニュアル検索!
252件ヒット [101-200件を表示] (0.103秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

検索結果

<< < 1 2 3 > >>

Module#method_defined?(name, inherit=true) -> bool (38.0)

モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。

...す。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
see Module#public_method_defined?, Module#private_method_defined?, Module#protecte...
...d_method_defined?

//emlist[例][ruby]{
module
A
def method1() end
def protected_method1() end
protected :protected_method1
end
class B
def method2() end
def private_method2() end
private :private_method2
end
class C < B
include
A
def method3() end
end

A.method_defined? :method...

Module#private_method_defined?(name, inherit=true) -> bool (38.0)

インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が private であるときに true を返します。 そうでなければ false を返します。

...します。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
see Module#method_defined?, Module#public_method_defined?, Module#protected_...
...method_defined?

//emlist[例][ruby]{
module
A
def method1() end
end
class B
private
def method2() end
end
class C < B
include
A
def method3() end
end

A.method_defined? :method1 #=> true
C.private_method_defined? "method1" #=> false
C.private_method_defined?...

Module#protected_method_defined?(name, inherit=true) -> bool (38.0)

インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が protected であるときに true を返します。 そうでなければ false を返します。

...します。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
see Module#method_defined?, Module#public_method_defined?, Module#private_me...
...thod_defined?

//emlist[例][ruby]{
module
A
def method1() end
end
class B
protected
def method2() end
end
class C < B
include
A
def method3() end
end

A.method_defined? :method1 #=> true
C.protected_method_defined? "method1" #=> false
C.protected_method_defin...

Module#public_method_defined?(name, inherit=true) -> bool (38.0)

インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が public であるときに true を返します。 そうでなければ false を返します。

...ます。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
see Module#method_defined?, Module#private_method_defined?, Module#protected_me...
...thod_defined?

//emlist[例][ruby]{
module
A
def method1() end
end
class B
protected
def method2() end
end
class C < B
include
A
def method3() end
end

A.method_defined? :method1 #=> true
C.public_method_defined? "method1" #=> true
C.public_method_defined? "metho...

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

比較演算子。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.anc...

絞り込み条件を変える

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

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

...

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

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

@
see Module#<

//emlist[例][ruby]{
module
Awesome; end
module
Included
include
Awesome
end
module
Prepended
prepend Awesome
end

Include
d.a...
...ncestors # => [Included, Awesome]
Awesome > Included # => true
Include
d > Awesome # => false

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

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

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

比較演算子。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.anc...

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

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

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

このメソッドを上書きすることで、prepend の処理を変...
...できます。

@
param mod prepend を呼び出したモジュール
@
return mod が返されます

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

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

比較演算子。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)
//}...
<< < 1 2 3 > >>