Class: Google::Apis::Messages::Message
- Inherits:
-
Object
- Object
- Google::Apis::Messages::Message
- 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
-
#message_object ⇒ Object
Returns the value of attribute message_object.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Message
constructor
A new instance of Message.
- #initialize_build(**args) ⇒ Object
- #update!(**args) ⇒ Object
Constructor Details
#initialize(**args) ⇒ Message
Returns a new instance of Message.
9 10 11 |
# File 'lib/google/apis/messages/classes.rb', line 9 def initialize(**args) update!(**args) end |
Instance Attribute Details
#message_object ⇒ Object
Returns the value of attribute message_object.
7 8 9 |
# File 'lib/google/apis/messages/classes.rb', line 7 def end |
Instance Method Details
#initialize_build(**args) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/google/apis/messages/classes.rb', line 13 def initialize_build(**args) if args[:notification] notification = Notification.new( title: args[:notification][:title], body: args[:notification][:body] ) end = { topic: args[:topic], data: args[:payload] } if notification [:notification] = notification end if args.key?(:webpush) && args[:webpush][:icon] [:webpush] = Webpush.new(args[:webpush]) end = MessageObject.new() end |
#update!(**args) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/google/apis/messages/classes.rb', line 37 def update!(**args) if args.key?(:message_object) = args[:message_object] else initialize_build(**args) end end |