Class: WhatsappSdk::Api::Responses::MessageDataResponse
- Inherits:
-
Object
- Object
- WhatsappSdk::Api::Responses::MessageDataResponse
- Defined in:
- lib/whatsapp_sdk/api/responses/message_data_response.rb
Instance Attribute Summary collapse
-
#contacts ⇒ Object
Returns the value of attribute contacts.
-
#messages ⇒ Object
Returns the value of attribute messages.
Class Method Summary collapse
Instance Attribute Details
#contacts ⇒ Object
Returns the value of attribute contacts.
10 11 12 |
# File 'lib/whatsapp_sdk/api/responses/message_data_response.rb', line 10 def contacts @contacts end |
#messages ⇒ Object
Returns the value of attribute messages.
10 11 12 |
# File 'lib/whatsapp_sdk/api/responses/message_data_response.rb', line 10 def @messages end |
Class Method Details
.build_from_response(response:) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/whatsapp_sdk/api/responses/message_data_response.rb', line 13 def build_from_response(response:) return unless response["messages"] data_response = new data_response.contacts = response["contacts"]&.map { |contact_json| parse_contact(contact_json) } data_response. = response["messages"]&.map { |contact_json| (contact_json) } data_response end |