lib/xmlhasher/node.rb in xmlhasher-0.0.6 vs lib/xmlhasher/node.rb in xmlhasher-1.0.0
- old
+ new
@@ -8,10 +8,10 @@
@children = []
end
def to_hash
h = {}
- if text
+ if text && !text.empty?
h[name] = text
else
h[name] = attributes.inject({}) { |r, (key, value)| r[key] = value if !value.nil? && !value.to_s.empty?; r }
if children.size == 1
child = children.first