Class: RubyPushNotifications::WNS::WNSPusher
- Inherits:
-
Object
- Object
- RubyPushNotifications::WNS::WNSPusher
- Defined in:
- lib/ruby-push-notifications/wns/wns_pusher.rb
Overview
This class is responsible for sending notifications to the WNS service.
Instance Method Summary collapse
-
#initialize(access_token, options = {}) ⇒ WNSPusher
constructor
Initializes the WNSPusher.
-
#push(notifications) ⇒ Object
Actually pushes the given notifications.
Constructor Details
#initialize(access_token, options = {}) ⇒ WNSPusher
Initializes the WNSPusher
15 16 17 18 |
# File 'lib/ruby-push-notifications/wns/wns_pusher.rb', line 15 def initialize(access_token, = {}) @access_token = access_token @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.
25 26 27 28 29 |
# File 'lib/ruby-push-notifications/wns/wns_pusher.rb', line 25 def push(notifications) notifications.each do |notif| notif.results = WNSConnection.post notif, @access_token, @options end end |