563件ヒット
[1-100件を表示]
(0.057秒)
クラス
- Array (11)
- Hash (44)
- Method (22)
- Module (230)
- Object (110)
- Proc (5)
- Range (50)
- Refinement (3)
- String (11)
- TracePoint (11)
- UnboundMethod (11)
モジュール
- Enumerable (44)
- GC (11)
キーワード
- < (11)
- <= (11)
- <=> (11)
- === (11)
- > (11)
- >= (11)
- ancestors (11)
-
append
_ features (11) - bind (11)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ source _ location (5) - constants (11)
- cover? (17)
-
defined
_ class (11) -
each
_ entry (22) - extend (11)
-
garbage
_ collect (11) -
has
_ key? (11) -
import
_ methods (3) - include? (66)
- included (11)
-
included
_ modules (11) - inspect (11)
-
is
_ a? (11) - key? (11)
-
kind
_ of? (11) - member? (33)
-
method
_ defined? (11) - methods (11)
-
prepend
_ features (11) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
private
_ methods (11) -
protected
_ method _ defined? (11) -
protected
_ methods (11) -
public
_ method _ defined? (11) -
public
_ methods (11) -
respond
_ to? (11) -
respond
_ to _ missing? (11) -
ruby2
_ keywords (10) -
singleton
_ methods (11) -
to
_ s (11)
検索結果
先頭5件
-
Module
# include(*mod) -> self (18170.0) -
モジュール mod をインクルードします。
...てしまうような include を行った場合に発生します。
//emlist[例][ruby]{
module M
end
module M2
include M
end
module M
include M2
end
//}
実行結果:
-:3:in `append_features': cyclic include detected (ArgumentError)
from -:3:in `include'
from -:3......。
インクルードは多重継承の代わりに用いられており、 mix-in とも呼びます。
//emlist[例][ruby]{
class C
include FileTest
include Math
end
p C.ancestors
# => [C, Math, FileTest, Object, Kernel]
//}
モジュールの機能追加は、クラスの継承関係の......ッド探索の順序です)。
同じモジュールを二回以上 include すると二回目以降は無視されます。
//emlist[例][ruby]{
module M
end
class C1
include M
end
class C2 < C1
include M # この include は無視される
end
p C2.ancestors # => [C2, C1, M, Object, Ker... -
Module
# included(class _ or _ module) -> () (6143.0) -
self が Module#include されたときに対象のクラスまたはモジュー ルを引数にしてインタプリタがこのメソッドを呼び出します。
...f が Module#include されたときに対象のクラスまたはモジュー
ルを引数にしてインタプリタがこのメソッドを呼び出します。
@param class_or_module Module#include を実行したオブジェクト
//emlist[例][ruby]{
module Foo
def self.included(mod)
p......"#{mod} include #{self}"
end
end
class Bar
include Foo
end
# => "Bar include Foo"
//}
@see Module#append_features... -
Range
# include?(obj) -> bool (6128.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...クトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range#cover?, Ran... -
Module
# include?(mod) -> bool (6122.0) -
self かその親クラス / 親モジュールがモジュール mod を インクルードしていれば true を返します。
...クラス / 親モジュールがモジュール mod を
インクルードしていれば true を返します。
@param mod Module を指定します。
//emlist[例][ruby]{
module M
end
class C1
include M
end
class C2 < C1
end
p C1.include?(M) # => true
p C2.include?(M) # => true
//}... -
String
# include?(substr) -> bool (6122.0) -
文字列中に部分文字列 substr が含まれていれば真を返します。
...文字列中に部分文字列 substr が含まれていれば真を返します。
@param substr 検索する文字列
//emlist[例][ruby]{
"hello".include? "lo" #=> true
"hello".include? "ol" #=> false
"hello".include? ?h #=> true
//}... -
Array
# include?(val) -> bool (6116.0) -
配列が val と == で等しい要素を持つ時に真を返します。
...配列が val と == で等しい要素を持つ時に真を返します。
@param val オブジェクトを指定します。
//emlist[例][ruby]{
a = [ "a", "b", "c" ]
a.include?("b") #=> true
a.include?("z") #=> false
//}... -
Enumerable
# include?(val) -> bool (6116.0) -
val と == の関係にある要素を含むとき真を返します。
...val と == の関係にある要素を含むとき真を返します。
@param val 任意のオブジェクト
//emlist[例][ruby]{
[2, 4, 6].include? 2 #=> true
[2, 4, 6].include? 1 #=> false
[2, 4, 6].member? 2 #=> true
[2, 4, 6].member? 1 #=> false
//}... -
Module
# included _ modules -> [Module] (6109.0) -
self にインクルードされているモジュールの配列を返します。
...self にインクルードされているモジュールの配列を返します。
//emlist[例][ruby]{
module Mixin
end
module Outer
include Mixin
end
Mixin.included_modules #=> []
Outer.included_modules #=> [Mixin]
//}
@see Module#ancestors... -
Range
# include?(obj) -> bool (3128.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...クトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range#cover?... -
Hash
# include?(key) -> bool (3104.0) -
ハッシュが key をキーとして持つ時真を返します。
ハッシュが key をキーとして持つ時真を返します。
@param key 探索するキーを指定します。
//emlist[][ruby]{
p({1 => "one"}.key?(1)) # => true
p({1 => "one"}.key?(2)) # => false
//}
@see Hash#value? -
Range
# member?(obj) -> bool (3028.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...クトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range#cover?, Ran...