Skip to content

CapyTheBeara/rangify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rangify

This gem will add the rangify method to Ruby’s Array class. The rangify method will produce appropriate ranges from the objects in the array.

Usage

Examples:

1,2,3,6,7,8].rangify = [1..3, 6..8
10..15, 16..20, 21, 22].rangify = [10..22

Assumes inclusive ranges (ie. 1..4) and range.first <= range.last.

Works with integers, dates and strings. However, all the objects in the array must be of the same class.

About

Combine array elements into ranges.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages