diff --git a/lib/oga/xml/attribute.rb b/lib/oga/xml/attribute.rb index 370aa62..5e5d7f5 100644 --- a/lib/oga/xml/attribute.rb +++ b/lib/oga/xml/attribute.rb @@ -101,11 +101,7 @@ module Oga full_name = name end - if value - enc_value = Entities.encode_attribute(value) - else - enc_value = nil - end + enc_value = value ? Entities.encode_attribute(value) : nil %Q(#{full_name}="#{enc_value}") end