Use ternary "if" when encoding attribute values
This commit is contained in:
1 parent
074b53c18c
commit
fe7e2e4f74
1 file changed
+1
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user