Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages