Fixup dkim_headers

Christopher Vollick created

Two here, first is a variable shadowing error because I used `h` in the
map, and also the `each_with_object`.

I now use `s` on the outside.

Second is that while `[x].flatten.compact` seemed to do what I wanted,
it seems like `Array(x)` does _nearly_ the same thing.
One important difference between the two is how `Array` works if `x` is
a hash, but in my case it's not, so for my purposes they're the same.

Cleaner!

Change summary

lib/interac_email.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Detailed changes

lib/interac_email.rb 🔗

@@ -143,8 +143,9 @@ class InteracEmail
 		def dkim_headers
 			# Apparently there can sometimes be multiple DKIM sigs
 			# And this library returns a scalar if there's one, or array otherwise
-			[@m["DKIM-Signature"]].flatten.compact.map { |h|
-				h.value
+			# This Array method, when passed `nil` even returns an emtpy list!
+			Array(@m["DKIM-Signature"]).map { |s|
+				s.value
 				&.split(/;\s*/)
 				&.each_with_object({}) { |f, h|
 					k, v = f.split("=", 2)