Class: ActiveNotifier::Transports::Pushmeup::Deliverable

Inherits:
Object
  • Object
show all
Defined in:
lib/active_notifier/transports/pushmeup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tokens, payload, network) ⇒ Deliverable

Returns a new instance of Deliverable.



67
68
69
70
71
# File 'lib/active_notifier/transports/pushmeup.rb', line 67

def initialize(tokens, payload, network)
  @payload = payload
  @tokens  = tokens
  @network = network
end

Instance Attribute Details

#networkObject

Returns the value of attribute network.



65
66
67
# File 'lib/active_notifier/transports/pushmeup.rb', line 65

def network
  @network
end

#payloadObject

Returns the value of attribute payload.



65
66
67
# File 'lib/active_notifier/transports/pushmeup.rb', line 65

def payload
  @payload
end

#tokensObject

Returns the value of attribute tokens.



65
66
67
# File 'lib/active_notifier/transports/pushmeup.rb', line 65

def tokens
  @tokens
end

Instance Method Details

#deliver_laterObject



77
78
79
# File 'lib/active_notifier/transports/pushmeup.rb', line 77

def deliver_later
  PushNotificationJob.perform_later(tokens, payload, network)
end

#deliver_nowObject



73
74
75
# File 'lib/active_notifier/transports/pushmeup.rb', line 73

def deliver_now
  ActiveNotifier::Transports::Pushmeup.deliver(tokens, payload, network)
end