Class: Pushr::MessageApns2
- Inherits:
-
Message
- Object
- Message
- Pushr::MessageApns2
- Defined in:
- lib/pushr/message_apns2.rb
Constant Summary collapse
- POSTFIX =
'apns2'
Instance Attribute Summary collapse
-
#alert ⇒ Object
Returns the value of attribute alert.
-
#apns_collapse_id ⇒ Object
Returns the value of attribute apns_collapse_id.
-
#apns_expiration ⇒ Object
Returns the value of attribute apns_expiration.
-
#apns_id ⇒ Object
Returns the value of attribute apns_id.
-
#apns_priority ⇒ Object
Returns the value of attribute apns_priority.
-
#apns_topic ⇒ Object
Returns the value of attribute apns_topic.
-
#badge ⇒ Object
Returns the value of attribute badge.
-
#category ⇒ Object
Returns the value of attribute category.
-
#content_available ⇒ Object
Returns the value of attribute content_available.
-
#custom_payload ⇒ Object
Returns the value of attribute custom_payload.
-
#mutable_content ⇒ Object
Returns the value of attribute mutable_content.
-
#sound ⇒ Object
Returns the value of attribute sound.
-
#token ⇒ Object
Returns the value of attribute token.
-
#url_args ⇒ Object
Returns the value of attribute url_args.
Instance Method Summary collapse
Instance Attribute Details
#alert ⇒ Object
Returns the value of attribute alert.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def alert @alert end |
#apns_collapse_id ⇒ Object
Returns the value of attribute apns_collapse_id.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def apns_collapse_id @apns_collapse_id end |
#apns_expiration ⇒ Object
Returns the value of attribute apns_expiration.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def apns_expiration @apns_expiration end |
#apns_id ⇒ Object
Returns the value of attribute apns_id.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def apns_id @apns_id end |
#apns_priority ⇒ Object
Returns the value of attribute apns_priority.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def apns_priority @apns_priority end |
#apns_topic ⇒ Object
Returns the value of attribute apns_topic.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def apns_topic @apns_topic end |
#badge ⇒ Object
Returns the value of attribute badge.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def badge @badge end |
#category ⇒ Object
Returns the value of attribute category.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def category @category end |
#content_available ⇒ Object
Returns the value of attribute content_available.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def content_available @content_available end |
#custom_payload ⇒ Object
Returns the value of attribute custom_payload.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def custom_payload @custom_payload end |
#mutable_content ⇒ Object
Returns the value of attribute mutable_content.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def mutable_content @mutable_content end |
#sound ⇒ Object
Returns the value of attribute sound.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def sound @sound end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def token @token end |
#url_args ⇒ Object
Returns the value of attribute url_args.
5 6 7 |
# File 'lib/pushr/message_apns2.rb', line 5 def url_args @url_args end |
Instance Method Details
#body ⇒ Object
14 15 16 |
# File 'lib/pushr/message_apns2.rb', line 14 def body JSON.dump().force_encoding(Encoding::BINARY) end |
#to_hash ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/pushr/message_apns2.rb', line 18 def to_hash hsh = { type: self.class.to_s, app: app, token: token, alert: alert, badge: badge, sound: sound, category: category, content_available: content_available, mutable_content: mutable_content, url_args: url_args, apns_id: apns_id, apns_expiration: apns_expiration, apns_priority: apns_priority, apns_topic: apns_topic, apns_collapse_id: apns_collapse_id, custom_payload: custom_payload } hsh[Pushr::Core.external_id_tag] = external_id if external_id hsh end |