Class: Whatsapp::Messages::Response::Contacts

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/whatsapp/messages/response/contacts.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input:, wa_id:) ⇒ Contacts

Returns a new instance of Contacts.

Parameters:

  • input (String)

    The input value of the contact.

  • wa_id (String)

    The WhatsApp ID of the contact.



17
18
19
20
# File 'lib/ruby/whatsapp/messages/response/contacts.rb', line 17

def initialize(input:, wa_id:)
  @input = input
  @wa_id = wa_id
end

Instance Attribute Details

#inputString

Returns:

  • (String)


9
10
11
# File 'lib/ruby/whatsapp/messages/response/contacts.rb', line 9

def input
  @input
end

#wa_idString

Returns:

  • (String)


13
14
15
# File 'lib/ruby/whatsapp/messages/response/contacts.rb', line 13

def wa_id
  @wa_id
end

Class Method Details

.deserialize(data) ⇒ Object

Deserializes a hash into a Messages::Response::Contacts object.

Parameters:

  • data (Hash)

    The hash representation of the contact response. @return [Messages::Response::Contacts] The deserialized contact response object.



26
27
28
29
30
31
# File 'lib/ruby/whatsapp/messages/response/contacts.rb', line 26

def deserialize(data)
  new(
    input: data["input"],
    wa_id: data["wa_id"]
  )
end