Class: WhatsappSdk::Resource::Contact
- Inherits:
-
Object
- Object
- WhatsappSdk::Resource::Contact
- Defined in:
- lib/whatsapp_sdk/resource/contact.rb
Instance Attribute Summary collapse
-
#addresses ⇒ Object
Returns the value of attribute addresses.
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#name ⇒ Object
Returns the value of attribute name.
-
#org ⇒ Object
Returns the value of attribute org.
-
#phones ⇒ Object
Returns the value of attribute phones.
-
#urls ⇒ Object
Returns the value of attribute urls.
Instance Method Summary collapse
-
#initialize(addresses:, birthday:, emails:, name:, org:, phones:, urls:) ⇒ Contact
constructor
A new instance of Contact.
- #to_h ⇒ Object
Constructor Details
#initialize(addresses:, birthday:, emails:, name:, org:, phones:, urls:) ⇒ Contact
Returns a new instance of Contact.
8 9 10 11 12 13 14 15 16 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 8 def initialize(addresses:, birthday:, emails:, name:, org:, phones:, urls:) @addresses = addresses @birthday = birthday @emails = emails @name = name @org = org @phones = phones @urls = urls end |
Instance Attribute Details
#addresses ⇒ Object
Returns the value of attribute addresses.
6 7 8 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 6 def addresses @addresses end |
#birthday ⇒ Object
Returns the value of attribute birthday.
6 7 8 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 6 def birthday @birthday end |
#emails ⇒ Object
Returns the value of attribute emails.
6 7 8 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 6 def emails @emails end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 6 def name @name end |
#org ⇒ Object
Returns the value of attribute org.
6 7 8 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 6 def org @org end |
#phones ⇒ Object
Returns the value of attribute phones.
6 7 8 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 6 def phones @phones end |
#urls ⇒ Object
Returns the value of attribute urls.
6 7 8 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 6 def urls @urls end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/whatsapp_sdk/resource/contact.rb', line 18 def to_h { addresses: addresses.map(&:to_h), birthday: birthday, emails: emails.map(&:to_h), name: name.to_h, org: org.to_h, phones: phones.map(&:to_h), urls: urls.map(&:to_h) } end |