Class: Incognia::Address::Structured
- Inherits:
-
Object
- Object
- Incognia::Address::Structured
- Defined in:
- lib/incognia_api/address.rb
Instance Attribute Summary collapse
-
#borough ⇒ Object
readonly
Returns the value of attribute borough.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#complements ⇒ Object
readonly
Returns the value of attribute complements.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#country_name ⇒ Object
readonly
Returns the value of attribute country_name.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#neighborhood ⇒ Object
readonly
Returns the value of attribute neighborhood.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#postal_code ⇒ Object
readonly
Returns the value of attribute postal_code.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#street ⇒ Object
readonly
Returns the value of attribute street.
Instance Method Summary collapse
-
#initialize(locale: nil, country_name: nil, country_code: nil, state: nil, city: nil, borough: nil, neighborhood: nil, postal_code: nil, street: nil, number: nil, complements: nil) ⇒ Structured
constructor
A new instance of Structured.
- #to_hash ⇒ Object
Constructor Details
#initialize(locale: nil, country_name: nil, country_code: nil, state: nil, city: nil, borough: nil, neighborhood: nil, postal_code: nil, street: nil, number: nil, complements: nil) ⇒ Structured
Returns a new instance of Structured.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/incognia_api/address.rb', line 32 def initialize(locale: nil, country_name: nil, country_code: nil, \ state: nil, city: nil, borough: nil, neighborhood: nil, \ postal_code: nil, street: nil, number: nil, complements: nil) @locale = locale @country_name = country_name @country_code = country_code @state = state @city = city @borough = borough @neighborhood = neighborhood @postal_code = postal_code @street = street @number = number @complements = complements end |
Instance Attribute Details
#borough ⇒ Object (readonly)
Returns the value of attribute borough.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def borough @borough end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def city @city end |
#complements ⇒ Object (readonly)
Returns the value of attribute complements.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def complements @complements end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def country_code @country_code end |
#country_name ⇒ Object (readonly)
Returns the value of attribute country_name.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def country_name @country_name end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def locale @locale end |
#neighborhood ⇒ Object (readonly)
Returns the value of attribute neighborhood.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def neighborhood @neighborhood end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def number @number end |
#postal_code ⇒ Object (readonly)
Returns the value of attribute postal_code.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def postal_code @postal_code end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def state @state end |
#street ⇒ Object (readonly)
Returns the value of attribute street.
28 29 30 |
# File 'lib/incognia_api/address.rb', line 28 def street @street end |
Instance Method Details
#to_hash ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/incognia_api/address.rb', line 49 def to_hash { structured_address: { locale: locale, country_name: country_name, country_code: country_code, state: state, city: city, borough: borough, neighborhood: neighborhood, street: street, number: number, complements: complements, postal_code: postal_code }.select { |_,v| !v.nil? } } end |