Class: Crusade::APNS::NotificationBuilder
- Inherits:
-
Object
- Object
- Crusade::APNS::NotificationBuilder
- Defined in:
- lib/crusade/apns/notification_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ NotificationBuilder
constructor
A new instance of NotificationBuilder.
- #with_action(action) ⇒ Object
- #with_body(body) ⇒ Object
- #with_device_token(device_token) ⇒ Object
- #with_title(title) ⇒ Object
- #with_url_args(url_args) ⇒ Object
Constructor Details
#initialize ⇒ NotificationBuilder
Returns a new instance of NotificationBuilder.
7 8 9 |
# File 'lib/crusade/apns/notification_builder.rb', line 7 def initialize self.notification = Crusade::APNS::Notification.new end |
Instance Method Details
#build ⇒ Object
11 12 13 |
# File 'lib/crusade/apns/notification_builder.rb', line 11 def build notification end |
#with_action(action) ⇒ Object
25 26 27 28 |
# File 'lib/crusade/apns/notification_builder.rb', line 25 def with_action(action) notification.action = action self end |
#with_body(body) ⇒ Object
20 21 22 23 |
# File 'lib/crusade/apns/notification_builder.rb', line 20 def with_body(body) notification.body = body self end |
#with_device_token(device_token) ⇒ Object
35 36 37 38 |
# File 'lib/crusade/apns/notification_builder.rb', line 35 def with_device_token(device_token) notification.device_token = device_token self end |
#with_title(title) ⇒ Object
15 16 17 18 |
# File 'lib/crusade/apns/notification_builder.rb', line 15 def with_title(title) notification.title = title self end |
#with_url_args(url_args) ⇒ Object
30 31 32 33 |
# File 'lib/crusade/apns/notification_builder.rb', line 30 def with_url_args(url_args) notification.url_args = url_args self end |