Class: WhatsappSdk::Resource::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsapp_sdk/resource/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(street:, city:, state:, zip:, country:, country_code:, type: AddressType::Home) ⇒ Address



8
9
10
11
12
13
14
15
16
# File 'lib/whatsapp_sdk/resource/address.rb', line 8

def initialize(street:, city:, state:, zip:, country:, country_code:, type: AddressType::Home)
  @street = street
  @city = city
  @state = state
  @zip = zip
  @country = country
  @country_code = country_code
  @type = type
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



6
7
8
# File 'lib/whatsapp_sdk/resource/address.rb', line 6

def city
  @city
end

#countryObject

Returns the value of attribute country.



6
7
8
# File 'lib/whatsapp_sdk/resource/address.rb', line 6

def country
  @country
end

#country_codeObject

Returns the value of attribute country_code.



6
7
8
# File 'lib/whatsapp_sdk/resource/address.rb', line 6

def country_code
  @country_code
end

#stateObject

Returns the value of attribute state.



6
7
8
# File 'lib/whatsapp_sdk/resource/address.rb', line 6

def state
  @state
end

#streetObject

Returns the value of attribute street.



6
7
8
# File 'lib/whatsapp_sdk/resource/address.rb', line 6

def street
  @street
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/whatsapp_sdk/resource/address.rb', line 6

def type
  @type
end

#zipObject

Returns the value of attribute zip.



6
7
8
# File 'lib/whatsapp_sdk/resource/address.rb', line 6

def zip
  @zip
end

Instance Method Details

#to_hObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/whatsapp_sdk/resource/address.rb', line 18

def to_h
  {
    street: @street,
    city: @city,
    state: @state,
    zip: @zip,
    country: @country,
    country_code: @country_code,
    type: @type
  }
end