lib/umbrellio_utils/misc.rb in umbrellio-utils-0.1.0 vs lib/umbrellio_utils/misc.rb in umbrellio-utils-0.2.0
- old
+ new
@@ -22,7 +22,11 @@
# Ranges go from high to low priority
def merge_ranges(*ranges)
ranges = ranges.map { |x| x.present? && x.size == 2 ? x : [nil, nil] }
ranges.first.zip(*ranges[1..]).map { |x| x.find(&:present?) }
end
+
+ def build_infinite_hash
+ Hash.new { |hash, key| hash[key] = Hash.new(&hash.default_proc) }
+ end
end
end