b5205ce6b2
PushTarget#push reads more naturally than Push#push. The push target is the thing that pushes notifications to a specific destination. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
369 B
Ruby
25 lines
369 B
Ruby
class Notification::PushTarget
|
|
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
|