lib/phlex/helpers.rb in phlex-1.10.0 vs lib/phlex/helpers.rb in phlex-1.10.1
- old
+ new
@@ -72,10 +72,12 @@
# @return [Hash]
def mix(*args)
args.each_with_object({}) do |object, result|
result.merge!(object) do |_key, old, new|
+ next new if old.nil?
+
case new
when Hash
old.is_a?(Hash) ? mix(old, new) : new
when Array
case old
@@ -93,9 +95,11 @@
else
new + [old]
end
when String
old.is_a?(String) ? "#{old} #{new}" : old + old.class[new]
+ when nil
+ old
else
new
end
end