lib/xml/mixup.rb in xml-mixup-0.1.15 vs lib/xml/mixup.rb in xml-mixup-0.1.16
- old
+ new
@@ -61,11 +61,12 @@
# @param obj [Object] the object to be flattened
# @param args [Array, nil] callback arguments
#
# @return [String] the attribute in question.
#
- def flatten_attr obj, args
+ def flatten_attr obj, args = []
return if obj.nil?
+ args ||= []
# early bailout for most likely condition
if ATOMS.any? { |x| obj.is_a? x }
obj.to_s
elsif obj.is_a? Hash
tmp = obj.sort.map do |kv|