lib/multi_range.rb in multi_range-2.2.1 vs lib/multi_range.rb in multi_range-2.2.2
- old
+ new
@@ -25,9 +25,10 @@
def initialize(ranges)
if ranges.is_a? MultiRange
@ranges = ranges.ranges
@is_float = ranges.is_float?
else
+ ranges = [ranges] if !ranges.is_a?(Array)
@ranges = ranges.map{|s| s.is_a?(Numeric) ? s..s : s }.sort_by(&:begin).freeze
@is_float = @ranges.any?{|range| range.begin.is_a?(Float) || range.end.is_a?(Float) }
end
end