Class: ZipCode

Inherits:
Object
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ ZipCode

Returns a new instance of ZipCode.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 4

def initialize(obj)
  @zipcode = obj['zipcode']
  @zipcode_type = obj['zipcode_type']
  @default_city = obj['default_city']
  @county_fips = obj['county_fips']
  @county_name = obj['county_name']
  @latitude = obj['latitude']
  @longitude = obj['longitude']
  @precision = obj['precision']
  @alternate_counties = obj.fetch('alternate_counties', [])
end

Instance Attribute Details

#alternate_countiesObject (readonly)

Returns the value of attribute alternate_counties.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def alternate_counties
  @alternate_counties
end

#county_fipsObject (readonly)

Returns the value of attribute county_fips.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def county_fips
  @county_fips
end

#county_nameObject (readonly)

Returns the value of attribute county_name.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def county_name
  @county_name
end

#default_cityObject (readonly)

Returns the value of attribute default_city.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def default_city
  @default_city
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def longitude
  @longitude
end

#precisionObject (readonly)

Returns the value of attribute precision.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def precision
  @precision
end

#zipcodeObject (readonly)

Returns the value of attribute zipcode.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def zipcode
  @zipcode
end

#zipcode_typeObject (readonly)

Returns the value of attribute zipcode_type.



2
3
4
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 2

def zipcode_type
  @zipcode_type
end