Class: Whatsapp::Webhook::Message::Contacts::Phone
- Inherits:
-
Object
- Object
- Whatsapp::Webhook::Message::Contacts::Phone
- Defined in:
- lib/ruby/whatsapp/webhook/message/contacts/phone.rb
Overview
A phone number entry within an inbound contact card.
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(phone:, type: nil, wa_id: nil) ⇒ Phone
constructor
A new instance of Phone.
Constructor Details
#initialize(phone:, type: nil, wa_id: nil) ⇒ Phone
Returns a new instance of Phone.
21 22 23 24 25 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/phone.rb', line 21 def initialize(phone:, type: nil, wa_id: nil) @phone = phone @type = type @wa_id = wa_id end |
Instance Attribute Details
#phone ⇒ String?
11 12 13 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/phone.rb', line 11 def phone @phone end |
#type ⇒ String?
15 16 17 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/phone.rb', line 15 def type @type end |
#wa_id ⇒ String?
19 20 21 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/phone.rb', line 19 def wa_id @wa_id end |
Class Method Details
.deserialize(data) ⇒ Phone
30 31 32 33 34 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/phone.rb', line 30 def deserialize(data) data ||= {} new(phone: data["phone"], type: data["type"], wa_id: data["wa_id"]) end |