vcard: take a parameter's value from the block, not off the pair
`last` on a pair says the last parameter, not the value half:
one word, two readings, and the wrong one reaches the eye first.
Now the block hands out the value it matched the name against,
and `first` means the first match, which is all the comment ever said.
Assisted-by: Claude Opus 5 via Claude Code
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015WjrPJFvetad8vvCHqjujh
diff --git a/lib/pro_tacts/vcard/parser.rb b/lib/pro_tacts/vcard/parser.rb
index 0fb4165..dbb339b 100644
--- a/lib/pro_tacts/vcard/parser.rb
+++ b/lib/pro_tacts/vcard/parser.rb
@@ -95,7 +95,9 @@ module ProTacts
# first of them, and a caller wanting both reads `parameters`.
#: (String name) -> String?
def parameter(name)
- parameters.find { |parameter, _| parameter.casecmp?(name) }&.last
+ parameters
+ .filter_map { |parameter, value| value if parameter.casecmp?(name) }
+ .first
end
end