Class: WhatsAppCloudApi::Types::SendMessageResponse
- Inherits:
-
Object
- Object
- WhatsAppCloudApi::Types::SendMessageResponse
- Defined in:
- lib/whatsapp_cloud_api/types.rb
Overview
Message response structure
Instance Attribute Summary collapse
-
#contacts ⇒ Object
readonly
Returns the value of attribute contacts.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#messaging_product ⇒ Object
readonly
Returns the value of attribute messaging_product.
Instance Method Summary collapse
-
#initialize(data) ⇒ SendMessageResponse
constructor
A new instance of SendMessageResponse.
Constructor Details
#initialize(data) ⇒ SendMessageResponse
Returns a new instance of SendMessageResponse.
24 25 26 27 28 |
# File 'lib/whatsapp_cloud_api/types.rb', line 24 def initialize(data) @messaging_product = data['messaging_product'] @contacts = data['contacts']&.map { |c| MessageContact.new(c) } || [] = data['messages']&.map { |m| MessageInfo.new(m) } || [] end |
Instance Attribute Details
#contacts ⇒ Object (readonly)
Returns the value of attribute contacts.
22 23 24 |
# File 'lib/whatsapp_cloud_api/types.rb', line 22 def contacts @contacts end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
22 23 24 |
# File 'lib/whatsapp_cloud_api/types.rb', line 22 def end |
#messaging_product ⇒ Object (readonly)
Returns the value of attribute messaging_product.
22 23 24 |
# File 'lib/whatsapp_cloud_api/types.rb', line 22 def messaging_product @messaging_product end |