lib/securetrading/xml_doc.rb in securetrading-0.3.0 vs lib/securetrading/xml_doc.rb in securetrading-0.3.1
- old
+ new
@@ -14,10 +14,10 @@
@doc << root
end
# rubocop:disable Metrics/MethodLength
def self.elements(hash)
- return '' unless hash.present?
+ return [''] unless hash.present?
hash.flat_map do |k, v|
return v.flat_map { |e| elements(k => e) } if v.is_a?(Array)
el = new_element(k.to_s)
if v.is_a?(Hash)
elements(v).each { |e| el << e }