Class: ZipCode
- Inherits:
-
Object
- Object
- ZipCode
- Defined in:
- lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb
Instance Attribute Summary collapse
-
#alternate_counties ⇒ Object
readonly
Returns the value of attribute alternate_counties.
-
#county_fips ⇒ Object
readonly
Returns the value of attribute county_fips.
-
#county_name ⇒ Object
readonly
Returns the value of attribute county_name.
-
#default_city ⇒ Object
readonly
Returns the value of attribute default_city.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#precision ⇒ Object
readonly
Returns the value of attribute precision.
-
#zipcode ⇒ Object
readonly
Returns the value of attribute zipcode.
-
#zipcode_type ⇒ Object
readonly
Returns the value of attribute zipcode_type.
Instance Method Summary collapse
-
#initialize(obj) ⇒ ZipCode
constructor
A new instance of ZipCode.
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_counties ⇒ Object (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_fips ⇒ Object (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_name ⇒ Object (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_city ⇒ Object (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 |
#latitude ⇒ Object (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 |
#longitude ⇒ Object (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 |
#precision ⇒ Object (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 |
#zipcode ⇒ Object (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_type ⇒ Object (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 |