Class: Google::Apis::Messages::MessageObject

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ MessageObject

Returns a new instance of MessageObject.



38
39
40
# File 'lib/google/apis/messages/classes.rb', line 38

def initialize(**args)
  update!(**args)
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



36
37
38
# File 'lib/google/apis/messages/classes.rb', line 36

def data
  @data
end

#notificationObject

Returns the value of attribute notification.



35
36
37
# File 'lib/google/apis/messages/classes.rb', line 35

def notification
  @notification
end

#topicObject

Returns the value of attribute topic.



34
35
36
# File 'lib/google/apis/messages/classes.rb', line 34

def topic
  @topic
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/google/apis/messages/classes.rb', line 43

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 = {}
    args[:data].each do |key, value|
      data[key.to_s] = value.to_s
    end

    @data = data
  end
end