class PushNotifications::UseCases::Notify

Attributes

interests[R]
payload[R]

Public Class Methods

new(interests:, payload: {}) click to toggle source
# File lib/push_notifications/use_cases/notify.rb, line 12
def initialize(interests:, payload: {})
  @interests = interests
  @payload = payload
end

Public Instance Methods

call() click to toggle source
# File lib/push_notifications/use_cases/notify.rb, line 17
def call
  data = { interests: interests }.merge!(payload)
  client.post('publishes', data)
end

Private Instance Methods

client() click to toggle source
# File lib/push_notifications/use_cases/notify.rb, line 26
def client
  @_client ||= PushNotifications::Client.new
end