Class: Google::Apis::Messages::MessageObject
- Inherits:
-
Object
- Object
- Google::Apis::Messages::MessageObject
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/messages/classes.rb,
lib/google/apis/messages/representations.rb,
lib/google/apis/messages/representations.rb
Defined Under Namespace
Classes: Representation
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#notification ⇒ Object
Returns the value of attribute notification.
-
#topic ⇒ Object
Returns the value of attribute topic.
-
#webpush ⇒ Object
Returns the value of attribute webpush.
Instance Method Summary collapse
-
#initialize(**args) ⇒ MessageObject
constructor
A new instance of MessageObject.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ MessageObject
Returns a new instance of MessageObject.
54 55 56 |
# File 'lib/google/apis/messages/classes.rb', line 54 def initialize(**args) update!(**args) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
51 52 53 |
# File 'lib/google/apis/messages/classes.rb', line 51 def data @data end |
#notification ⇒ Object
Returns the value of attribute notification.
50 51 52 |
# File 'lib/google/apis/messages/classes.rb', line 50 def notification @notification end |
#topic ⇒ Object
Returns the value of attribute topic.
49 50 51 |
# File 'lib/google/apis/messages/classes.rb', line 49 def topic @topic end |
#webpush ⇒ Object
Returns the value of attribute webpush.
52 53 54 |
# File 'lib/google/apis/messages/classes.rb', line 52 def webpush @webpush end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
59 60 61 62 63 64 65 66 |
# File 'lib/google/apis/messages/classes.rb', line 59 def update!(**args) @topic = args[:topic] if args.key?(:topic) @notification = args[:notification] if args.key?(:notification) if args.key?(:data) && args[:data].is_a?(Hash) @data = { 'payload' => JSON.dump(args[:data]) } end @webpush = args[:webpush] if args.key?(:webpush) end |