CodeReview#1 use of inject and tr instead of gsub.

The code is written well with a minimal documentation.
Some sugar can be added.

Personally I do not like this method which return multidimensional
object
a single min and max would be more clear at least to me. reading the
code, just a detail.
   def get_limits
    min = 100000
    max = 0
    lengths.each do |elem|
      min = elem[0] if min > elem[0]

      max = elem[0] if max < elem[0]
    end
    return [min,max]
  end