種類
- インスタンスメソッド (126)
- 特異メソッド (12)
クラス
-
Enumerator
:: ArithmeticSequence (21) - Range (117)
検索結果
先頭5件
-
Range
# exclude _ end? -> bool (6115.0) -
範囲オブジェクトが終端を含まないとき真を返します。
...範囲オブジェクトが終端を含まないとき真を返します。
//emlist[例][ruby]{
(1..5).exclude_end? # => false
(1...5).exclude_end? # => true
//}... -
Enumerator
:: ArithmeticSequence # exclude _ end? -> bool (6103.0) -
末項(終端)を含まないとき真を返します。
末項(終端)を含まないとき真を返します。 -
Range
. new(first , last , exclude _ end = false) -> Range (121.0) -
first から last までの範囲オブジェクトを生成して返しま す。
...生成して返しま
す。
exclude_end が真ならば終端を含まない範囲オブジェクトを生
成します。exclude_end 省略時には終端を含みます。
@param first 最初のオブジェクト
@param last 最後のオブジェクト
@param exclude_end 真をセットした... -
Range
# ==(other) -> bool (18.0) -
指定された other が Range クラスのインスタンスであり、 始端と終端が == メソッドで比較して等しく、Range#exclude_end? が同じ場合に true を返します。そうでない場合に false を返します。
...指定された other が Range クラスのインスタンスであり、
始端と終端が == メソッドで比較して等しく、Range#exclude_end? が同じ場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェ... -
Range
# eql?(other) -> bool (18.0) -
指定された other が Range クラスのインスタンスであり、 始端と終端が eql? メソッドで比較して等しく、Range#exclude_end? が同じ場合に true を返します。そうでない場合に false を返します。
...指定された other が Range クラスのインスタンスであり、
始端と終端が eql? メソッドで比較して等しく、Range#exclude_end? が同じ場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェ... -
Range
# hash -> Integer (18.0) -
始端と終端のハッシュ値と Range#exclude_end? の値からハッシュ値を計算して整数として返します。
...始端と終端のハッシュ値と Range#exclude_end? の値からハッシュ値を計算して整数として返します。
//emlist[例][ruby]{
p (1..2).hash # => 5646
p (1...2).hash # => 16782863
//}... -
Enumerator
:: ArithmeticSequence # ==(other) -> bool (8.0) -
Enumerable::ArithmeticSequence として等しいか判定します。
...Enumerable::ArithmeticSequence として等しいか判定します。
other が Enumerable::ArithmeticSequence で
begin, end, step, exclude_end? が等しい時に
true を返します。
@param other 自身と比較する Enumerable::ArithmeticSequence... -
Enumerator
:: ArithmeticSequence # hash -> Integer (8.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
begin, end, step, exclude_end? が等しい Enumerable::ArithmeticSequence は
同じハッシュ値を返します。... -
Range
# cover?(obj) -> bool (8.0) -
obj が範囲内に含まれている時に true を返します。
...、
Range#cover? は連続値を扱います。
(数値については、例外として Range#include? も連続的に扱います。)
Range#exclude_end?がfalseなら「begin <= obj <= end」を、
trueなら「begin <= obj < end」を意味します。
@param obj 比較対象のオブジェ... -
Range
# last(n) -> [object] (8.0) -
最後の n 要素を返します。範囲内に要素が含まれない場合は空の配列を返します。
...n に負の数を指定した場合に発生します。
[注意] 引数を省略して実行した場合は、終端を含むかどうか
(Range#exclude_end? の戻り値)に関わらず終端の要素を返す事に注意し
てください。
//emlist[例][ruby]{
(10..20).last(3) # => [18, 19...