Class: Whatsapp::Webhook::Message::Contacts::Address
- Inherits:
-
Object
- Object
- Whatsapp::Webhook::Message::Contacts::Address
- Defined in:
- lib/ruby/whatsapp/webhook/message/contacts/address.rb
Overview
A physical address entry within an inbound contact card.
Instance Attribute Summary collapse
- #city ⇒ String?
- #country ⇒ String?
- #country_code ⇒ String?
- #state ⇒ String?
- #street ⇒ String?
- #type ⇒ String?
- #zip ⇒ String?
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(street: nil, city: nil, state: nil, zip: nil, country: nil, country_code: nil, type: nil) ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize(street: nil, city: nil, state: nil, zip: nil, country: nil, country_code: nil, type: nil) ⇒ Address
Returns a new instance of Address.
37 38 39 40 41 42 43 44 45 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 37 def initialize(street: nil, city: nil, state: nil, zip: nil, country: nil, country_code: nil, type: nil) @street = street @city = city @state = state @zip = zip @country = country @country_code = country_code @type = type end |
Instance Attribute Details
#city ⇒ String?
15 16 17 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 15 def city @city end |
#country ⇒ String?
27 28 29 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 27 def country @country end |
#country_code ⇒ String?
31 32 33 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 31 def country_code @country_code end |
#state ⇒ String?
19 20 21 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 19 def state @state end |
#street ⇒ String?
11 12 13 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 11 def street @street end |
#type ⇒ String?
35 36 37 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 35 def type @type end |
#zip ⇒ String?
23 24 25 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 23 def zip @zip end |
Class Method Details
.deserialize(data) ⇒ Address
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ruby/whatsapp/webhook/message/contacts/address.rb', line 50 def deserialize(data) data ||= {} new( street: data["street"], city: data["city"], state: data["state"], zip: data["zip"], country: data["country"], country_code: data["country_code"], type: data["type"] ) end |