Project

General

Profile

Actions

Feature #14473

closed

Add Range#subrange?

Added by greggzst (Grzegorz Jakubiak) almost 7 years ago. Updated about 6 years ago.

Status:
Closed
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

Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0