Use ternary "if" when encoding attribute values

This commit is contained in:
Yorick Peterse 2015-06-16 22:48:42 +02:00
parent 074b53c18c
commit fe7e2e4f74
1 changed files with 1 additions and 5 deletions

View File

@ -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