別のキーワード
ライブラリ
- ビルトイン (446)
- csv (12)
- pathname (48)
- rake (12)
-
rake
/ packagetask (12) -
rexml
/ streamlistener (12) -
rubygems
/ version (12) - set (13)
- tsort (47)
クラス
- Array (12)
-
CSV
:: Row (12) -
Gem
:: Version (12) - Hash (12)
- Method (24)
- Module (228)
- Object (72)
- Pathname (48)
-
Rake
:: FileList (12) -
Rake
:: PackageTask (12) - Range (19)
- Refinement (4)
- Set (16)
- String (12)
- TracePoint (12)
- UnboundMethod (12)
モジュール
- Enumerable (24)
- GC (12)
-
REXML
:: StreamListener (12) - TSort (47)
キーワード
- < (12)
- <= (12)
- <=> (12)
- > (12)
- >= (12)
- bind (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - constants (12)
-
defined
_ class (12) -
each
_ child (24) -
each
_ entry (12) -
each
_ strongly _ connected _ component (12) -
each
_ strongly _ connected _ component _ from (23) - entitydecl (12)
- entries (12)
- eql? (12)
-
garbage
_ collect (12) -
import
_ methods (4) - include? (96)
- included (12)
-
included
_ modules (12) - inspect (12)
-
is
_ a? (12) -
kind
_ of? (12) - member? (23)
-
method
_ defined? (12) - methods (12)
-
package
_ files (12) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ method _ defined? (12) - resolve (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) -
ruby2
_ keywords (12) -
singleton
_ methods (12) -
to
_ s (12) -
tsort
_ each (12)
検索結果
先頭5件
-
Module
# include(*mod) -> self (24304.0) -
モジュール mod をインクルードします。
...定します。
@raise ArgumentError 継承関係が循環してしまうような include を行った場合に発生します。
//emlist[例][ruby]{
module M
end
module M2
include M
end
module M
include M2
end
//}
実行結果:
-:3:in `append_features': cyclic include detected (Argument......in `include'
from -:3
インクルードとは、指定されたモジュールの定義
(メソッド、定数) を引き継ぐことです。
インクルードは多重継承の代わりに用いられており、 mix-in とも呼びます。
//emlist[例][ruby]{
class C
include Fi......leTest
include Math
end
p C.ancestors
# => [C, Math, FileTest, Object, Kernel]
//}
モジュールの機能追加は、クラスの継承関係の間にそのモジュールが挿入
されることで実現されています。従って、メソッドの探索などは
スーパークラスよ... -
String
# include?(substr) -> bool (15232.0) -
文字列中に部分文字列 substr が含まれていれば真を返します。
...文字列中に部分文字列 substr が含まれていれば真を返します。
@param substr 検索する文字列
//emlist[例][ruby]{
"hello".include? "lo" #=> true
"hello".include? "ol" #=> false
"hello".include? ?h #=> true
//}... -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (12379.0) -
For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.
...given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the fi......al hash argument is marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed thr......ethods.
This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before... -
Module
# included(class _ or _ module) -> () (12253.0) -
self が Module#include されたときに対象のクラスまたはモジュー ルを引数にしてインタプリタがこのメソッドを呼び出します。
...e#include されたときに対象のクラスまたはモジュー
ルを引数にしてインタプリタがこのメソッドを呼び出します。
@param class_or_module Module#include を実行したオブジェクト
//emlist[例][ruby]{
module Foo
def self.included(mod)
p "#{mod} in......clude #{self}"
end
end
class Bar
include Foo
end
# => "Bar include Foo"
//}
@see Module#append_features... -
Range
# include?(obj) -> bool (12238.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... -
Module
# include?(mod) -> bool (12232.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
//}... -
Array
# include?(val) -> bool (12226.0) -
配列が val と == で等しい要素を持つ時に真を返します。
...配列が val と == で等しい要素を持つ時に真を返します。
@param val オブジェクトを指定します。
//emlist[例][ruby]{
a = [ "a", "b", "c" ]
a.include?("b") #=> true
a.include?("z") #=> false
//}... -
Enumerable
# include?(val) -> bool (12226.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
//}... -
Set
# include?(o) -> bool (12226.0) -
オブジェクト o がその集合に属する場合に true を返します。
...オブジェクト o がその集合に属する場合に true を返します。
@param o オブジェクトを指定します。
//emlist[][ruby]{
require 'set'
set = Set['hello', 'world']
p set.include?('world') # => true
p set.include?('bye') # => false
//}... -
Module
# included _ modules -> [Module] (12219.0) -
self にインクルードされているモジュールの配列を返します。
...self にインクルードされているモジュールの配列を返します。
//emlist[例][ruby]{
module Mixin
end
module Outer
include Mixin
end
Mixin.included_modules #=> []
Outer.included_modules #=> [Mixin]
//}
@see Module#ancestors...