lib/multi_range.rb in multi_range-2.1.0 vs lib/multi_range.rb in multi_range-2.1.1
- old
+ new
@@ -130,10 +130,10 @@
end
def sample
range = RouletteWheelSelection.sample(@ranges.map{|s| [s, s.size] }.to_h)
return nil if range == nil
- return rand(range.max - range.min) + range.min
+ return rand(range)
end
def size
@ranges.inject(0){|sum, v| sum + v.size }
end