Class: MessengerPlatform::Contact
- Inherits:
-
Object
- Object
- MessengerPlatform::Contact
- Defined in:
- lib/messenger_platform/contact.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Contact
constructor
A new instance of Contact.
- #serialize ⇒ Object
Constructor Details
#initialize(hash) ⇒ Contact
Returns a new instance of Contact.
5 6 7 8 |
# File 'lib/messenger_platform/contact.rb', line 5 def initialize(hash) @id = hash[:id] @phone_number = hash[:phone_number] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/messenger_platform/contact.rb', line 3 def id @id end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
3 4 5 |
# File 'lib/messenger_platform/contact.rb', line 3 def phone_number @phone_number end |
Instance Method Details
#serialize ⇒ Object
10 11 12 |
# File 'lib/messenger_platform/contact.rb', line 10 def serialize id.present? ? { id: id } : { phone_number: phone_number } end |