Class: WebpushPayload
- Inherits:
-
Struct
- Object
- Struct
- WebpushPayload
- Defined in:
- app/models/webpush_payload.rb
Overview
El payload que se envía en la notificación
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#message ⇒ Object
Returns the value of attribute message.
-
#subject ⇒ Object
Returns the value of attribute subject.
Class Method Summary collapse
Instance Method Summary collapse
-
#to_json(opts = nil) ⇒ Object
Convertir el payload a JSON para poder enviarlo.
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint
8 9 10 |
# File 'app/models/webpush_payload.rb', line 8 def endpoint @endpoint end |
#message ⇒ Object
Returns the value of attribute message
8 9 10 |
# File 'app/models/webpush_payload.rb', line 8 def @message end |
#subject ⇒ Object
Returns the value of attribute subject
8 9 10 |
# File 'app/models/webpush_payload.rb', line 8 def subject @subject end |
Class Method Details
.from_json(string) ⇒ Object
17 18 19 |
# File 'app/models/webpush_payload.rb', line 17 def self.from_json(string) new(JSON.parse(string)) end |
Instance Method Details
#to_json(opts = nil) ⇒ Object
Convertir el payload a JSON para poder enviarlo
13 14 15 |
# File 'app/models/webpush_payload.rb', line 13 def to_json(opts = nil) to_h.to_json(opts) end |