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.
Constant Summary collapse
- COMMAND =
Constants
0
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.
8 9 10 11 12 13 |
# File 'lib/apns_dispatch/apn_notification.rb', line 8 def initialize(connection, token, , = {}) @connection = connection @token = token @message = @options = end |
Instance Method Details
#send_notification ⇒ Object
15 16 17 |
# File 'lib/apns_dispatch/apn_notification.rb', line 15 def send_notification @connection.write notification_packet end |