Class: APNS::Device
- Inherits:
-
Object
- Object
- APNS::Device
- Defined in:
- lib/apns/device.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(device_token) ⇒ Device
constructor
A new instance of Device.
- #to_payload ⇒ Object
Constructor Details
#initialize(device_token) ⇒ Device
Returns a new instance of Device.
6 7 8 9 |
# File 'lib/apns/device.rb', line 6 def initialize(device_token) # cleanup token self.token = device_token.gsub(/[\s|<|>]/,'') end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/apns/device.rb', line 4 def token @token end |
Instance Method Details
#to_payload ⇒ Object
11 12 13 |
# File 'lib/apns/device.rb', line 11 def to_payload [token].pack('H*') end |