Class: SmartyStreets::USZipcode::ZipCode
- Inherits:
-
Object
- Object
- SmartyStreets::USZipcode::ZipCode
- Defined in:
- lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb
Overview
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.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#state_abbreviation ⇒ Object
readonly
Returns the value of attribute state_abbreviation.
-
#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.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 11 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'] @state = obj['state'] @state_abbreviation = obj['state_abbreviation'] alternate_counties = obj.fetch('alternate_counties', []) @alternate_counties = [] alternate_counties.each do |county| @alternate_counties.push(USZipcode::AlternateCounty.new(county)) end end |
Instance Attribute Details
#alternate_counties ⇒ Object (readonly)
Returns the value of attribute alternate_counties.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def alternate_counties @alternate_counties end |
#county_fips ⇒ Object (readonly)
Returns the value of attribute county_fips.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def county_fips @county_fips end |
#county_name ⇒ Object (readonly)
Returns the value of attribute county_name.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def county_name @county_name end |
#default_city ⇒ Object (readonly)
Returns the value of attribute default_city.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def default_city @default_city end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def longitude @longitude end |
#precision ⇒ Object (readonly)
Returns the value of attribute precision.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def precision @precision end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def state @state end |
#state_abbreviation ⇒ Object (readonly)
Returns the value of attribute state_abbreviation.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def state_abbreviation @state_abbreviation end |
#zipcode ⇒ Object (readonly)
Returns the value of attribute zipcode.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def zipcode @zipcode end |
#zipcode_type ⇒ Object (readonly)
Returns the value of attribute zipcode_type.
7 8 9 |
# File 'lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb', line 7 def zipcode_type @zipcode_type end |