06c9ece058
The notification now owns its payload via #payload method in Pushable, allowing direct access like notification.payload.title. Push classes simply use the notification's payload rather than building it themselves. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
363 B
Ruby
25 lines
363 B
Ruby
class Notification::Push
|
|
attr_reader :notification
|
|
|
|
delegate :card, to: :notification
|
|
|
|
def initialize(notification)
|
|
@notification = notification
|
|
end
|
|
|
|
def push
|
|
return unless should_push?
|
|
|
|
perform_push
|
|
end
|
|
|
|
private
|
|
def should_push?
|
|
notification.pushable?
|
|
end
|
|
|
|
def perform_push
|
|
raise NotImplementedError
|
|
end
|
|
end
|