Project

General

Profile

Actions

Bug #9604

closed

Comparing ranges or range includes range

Added by watman (Nick Kotykhov) about 10 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0p0 (2013-12-25 revision 44422)
Backport:
[ruby-core:61339]

Description

Hello guys,

First I got to say it's not like real bug - but will be good to have. Then in some case I I need compare to ranges on including each other: so I did like
(1..10).include? (2..7)
what kinda logical, but it always false. So I have to use:
(1..10).grep(2..7).empty?

Actions

Also available in: Atom PDF

Like0
Like0