Project

General

Profile

Feature #14473

Add Range#subrange?

Added by greggzst (Grzegorz Jakubiak) 5 days ago. Updated 2 days ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:85528]

Description

Hi there,

I'd like to propose a method that returns true when a range that the method gets called on is a subrange of a range passed in as an argument.

Example:

(2..4).subrange?(1...4) 
=> true
(-2..2).subrange?(-1..3) 
=> false

History

#1 Updated by duerst (Martin Dürst) 4 days ago

  • Backport deleted (2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN)
  • Tracker changed from Bug to Feature

#2 Updated by greggzst (Grzegorz Jakubiak) 2 days ago

  • Subject changed from Range#subrange? to Add Range#subrange?

Also available in: Atom PDF