From b2c51d0fb4fbb92a74507174215a6388b8e896cc Mon Sep 17 00:00:00 2001 From: Alexander Logvinov Date: Tue, 11 Mar 2025 15:58:46 +0800 Subject: [PATCH] Use memoization for the aps method --- lib/apnotic/notification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apnotic/notification.rb b/lib/apnotic/notification.rb index 12fd1df..8e74360 100644 --- a/lib/apnotic/notification.rb +++ b/lib/apnotic/notification.rb @@ -14,7 +14,7 @@ def background_notification? private def aps - {}.tap do |result| + @aps ||= {}.tap do |result| result.merge!(alert: alert) if alert result.merge!(badge: badge) if badge result.merge!(sound: sound) if sound