Class: Crusade::APNS::Notification
- Inherits:
-
Object
- Object
- Crusade::APNS::Notification
- Defined in:
- lib/crusade/apns/notification.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#body ⇒ Object
Returns the value of attribute body.
-
#device_token ⇒ Object
Returns the value of attribute device_token.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url_args ⇒ Object
Returns the value of attribute url_args.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Notification
constructor
A new instance of Notification.
- #json_size ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Notification
Returns a new instance of Notification.
6 7 8 9 10 11 12 |
# File 'lib/crusade/apns/notification.rb', line 6 def initialize(attrs = {} ) self.title = attrs.fetch(:title) { nil } self.body = attrs.fetch(:body) { nil } self.action = attrs.fetch(:action) { nil } self.url_args = attrs.fetch(:url_args) { [] } self.device_token = attrs.fetch(:device_token) { nil } end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
4 5 6 |
# File 'lib/crusade/apns/notification.rb', line 4 def action @action end |
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/crusade/apns/notification.rb', line 4 def body @body end |
#device_token ⇒ Object
Returns the value of attribute device_token.
4 5 6 |
# File 'lib/crusade/apns/notification.rb', line 4 def device_token @device_token end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/crusade/apns/notification.rb', line 4 def title @title end |
#url_args ⇒ Object
Returns the value of attribute url_args.
4 5 6 |
# File 'lib/crusade/apns/notification.rb', line 4 def url_args @url_args end |
Instance Method Details
#json_size ⇒ Object
18 19 20 |
# File 'lib/crusade/apns/notification.rb', line 18 def json_size to_json.size end |
#to_json ⇒ Object
14 15 16 |
# File 'lib/crusade/apns/notification.rb', line 14 def to_json payload.to_json end |