Class: RubyPushNotifications::MPNS::MPNSPusher
- Inherits:
-
Object
- Object
- RubyPushNotifications::MPNS::MPNSPusher
- Defined in:
- lib/ruby-push-notifications/mpns/mpns_pusher.rb
Overview
This class is responsible for sending notifications to the MPNS service.
Instance Method Summary collapse
-
#initialize(certificate = nil, options = {}) ⇒ MPNSPusher
constructor
Initializes the MPNSPusher.
-
#push(notifications) ⇒ Object
Actually pushes the given notifications.
Constructor Details
#initialize(certificate = nil, options = {}) ⇒ MPNSPusher
Initializes the MPNSPusher
16 17 18 19 |
# File 'lib/ruby-push-notifications/mpns/mpns_pusher.rb', line 16 def initialize(certificate = nil, = {}) @certificate = certificate @options = end |
Instance Method Details
#push(notifications) ⇒ Object
Actually pushes the given notifications. Assigns every notification an array with the result of each individual notification.
26 27 28 29 30 |
# File 'lib/ruby-push-notifications/mpns/mpns_pusher.rb', line 26 def push(notifications) notifications.each do |notif| notif.results = MPNSConnection.post notif, @certificate, @options end end |