Class: Firepush::MessageType::Notification
- Defined in:
- lib/firepush/message_type/notification.rb
Instance Attribute Summary collapse
- #body ⇒ String readonly
- #title ⇒ String readonly
Instance Method Summary collapse
-
#initialize(title:, body:) ⇒ Notification
constructor
A new instance of Notification.
- #valid? ⇒ Boolean
- #value ⇒ Hash
Methods inherited from Base
Constructor Details
#initialize(title:, body:) ⇒ Notification
Returns a new instance of Notification.
11 12 13 14 |
# File 'lib/firepush/message_type/notification.rb', line 11 def initialize(title:, body:) @title = title @body = body end |
Instance Attribute Details
#body ⇒ String (readonly)
7 8 9 |
# File 'lib/firepush/message_type/notification.rb', line 7 def body @body end |
#title ⇒ String (readonly)
6 7 8 |
# File 'lib/firepush/message_type/notification.rb', line 6 def title @title end |
Instance Method Details
#valid? ⇒ Boolean
18 19 20 |
# File 'lib/firepush/message_type/notification.rb', line 18 def valid? valid_str?(title) && valid_str?(body) end |
#value ⇒ Hash
24 25 26 |
# File 'lib/firepush/message_type/notification.rb', line 24 def value { title: title, body: body } end |