このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ

Ruby 3.1 リファレンスマニュアル

instance method Range#exclude_end?

exclude_end? -> bool[permalink][rdoc][edit]

範囲オブジェクトが終端を含まないとき真を返します。

p (1..5).exclude_end?   # => false
p (1...5).exclude_end?  # => true