Class: ApnsDispatch::ApnNotification
- Inherits:
-
Object
- Object
- ApnsDispatch::ApnNotification
- Defined in:
- lib/apns_dispatch/apn_notification.rb
Overview
Creates a packaged notification for the APNs. Based on code from github.com/jpoz/APNS.
Instance Method Summary collapse
-
#initialize(connection, token, message, options = {}) ⇒ ApnNotification
constructor
A new instance of ApnNotification.
- #send_notification ⇒ Object
Constructor Details
#initialize(connection, token, message, options = {}) ⇒ ApnNotification
Returns a new instance of ApnNotification.
5 6 7 8 9 10 |
# File 'lib/apns_dispatch/apn_notification.rb', line 5 def initialize(connection, token, , = {}) @connection = connection @token = token @message = @options = end |
Instance Method Details
#send_notification ⇒ Object
12 13 14 |
# File 'lib/apns_dispatch/apn_notification.rb', line 12 def send_notification @connection.write notification_packet end |