Class: Sendly::WhatsAppSenderProfile
- Inherits:
-
Object
- Object
- Sendly::WhatsAppSenderProfile
- Defined in:
- lib/sendly/whatsapp_resource.rb
Overview
A sender's WhatsApp business profile — what recipients see when they
open the sender's details in WhatsApp. Unset fields are nil.
profile_photo_url is read-only here: the photo cannot be set through
Sendly::WhatsAppSendersResource#update_profile.
Instance Attribute Summary collapse
-
#about ⇒ Object
readonly
Returns the value of attribute about.
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
-
#profile_photo_url ⇒ Object
readonly
Returns the value of attribute profile_photo_url.
-
#website ⇒ Object
readonly
Returns the value of attribute website.
Instance Method Summary collapse
-
#initialize(data) ⇒ WhatsAppSenderProfile
constructor
A new instance of WhatsAppSenderProfile.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ WhatsAppSenderProfile
Returns a new instance of WhatsAppSenderProfile.
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/sendly/whatsapp_resource.rb', line 117 def initialize(data) @phone_number = data["phoneNumber"] || data["phone_number"] @display_name = data["displayName"] || data["display_name"] @profile_photo_url = data["profilePhotoUrl"] || data["profile_photo_url"] @category = data["category"] @about = data["about"] @description = data["description"] @email = data["email"] @website = data["website"] @address = data["address"] end |
Instance Attribute Details
#about ⇒ Object (readonly)
Returns the value of attribute about.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def about @about end |
#address ⇒ Object (readonly)
Returns the value of attribute address.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def address @address end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def category @category end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def description @description end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def display_name @display_name end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def email @email end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def phone_number @phone_number end |
#profile_photo_url ⇒ Object (readonly)
Returns the value of attribute profile_photo_url.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def profile_photo_url @profile_photo_url end |
#website ⇒ Object (readonly)
Returns the value of attribute website.
114 115 116 |
# File 'lib/sendly/whatsapp_resource.rb', line 114 def website @website end |
Instance Method Details
#to_h ⇒ Object
129 130 131 132 133 134 135 136 |
# File 'lib/sendly/whatsapp_resource.rb', line 129 def to_h { phone_number: phone_number, display_name: display_name, profile_photo_url: profile_photo_url, category: category, about: about, description: description, email: email, website: website, address: address }.compact end |