Class: Whatsapp::MessageTemplates::Button::PhoneNumber
- Defined in:
- lib/ruby/whatsapp/message_templates/button/phone_number.rb
Overview
Places a phone call to the business when tapped.
At most one per template. Meta may strip leading zeros that follow the country code, so store the number in full international form. Source: https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/components/
Defined Under Namespace
Modules: Defaults
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(text:, phone_number:) ⇒ PhoneNumber
constructor
A new instance of PhoneNumber.
-
#serialize ⇒ Hash
The serialized button.
Methods inherited from Base
Methods included from ValueObject
Constructor Details
#initialize(text:, phone_number:) ⇒ PhoneNumber
Returns a new instance of PhoneNumber.
31 32 33 34 35 36 |
# File 'lib/ruby/whatsapp/message_templates/button/phone_number.rb', line 31 def initialize(text:, phone_number:) @text = text @phone_number = phone_number validate! end |
Instance Attribute Details
#phone_number ⇒ String
23 24 25 |
# File 'lib/ruby/whatsapp/message_templates/button/phone_number.rb', line 23 def phone_number @phone_number end |
#text ⇒ String
19 20 21 |
# File 'lib/ruby/whatsapp/message_templates/button/phone_number.rb', line 19 def text @text end |