Class: PushNotifications::UseCases::Notify

Inherits:
Object
  • Object
show all
Includes:
Caze
Defined in:
lib/push_notifications/use_cases/notify.rb

Instance Method Summary collapse

Constructor Details

#initialize(interests:, payload: {}) ⇒ Notify

Returns a new instance of Notify.



12
13
14
15
# File 'lib/push_notifications/use_cases/notify.rb', line 12

def initialize(interests:, payload: {})
  @interests = interests
  @payload = payload
end

Instance Method Details

#callObject



17
18
19
20
# File 'lib/push_notifications/use_cases/notify.rb', line 17

def call
  data = { interests: interests }.merge!(payload)
  client.post('publishes', data)
end