Class: ChicagoOwnedLand::CityProperty
- Inherits:
-
Object
- Object
- ChicagoOwnedLand::CityProperty
- Defined in:
- lib/chicago_owned_land.rb
Instance Attribute Summary collapse
-
#community_area ⇒ Object
readonly
Returns the value of attribute community_area.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#human_address ⇒ Object
readonly
Returns the value of attribute human_address.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#needs_recoding ⇒ Object
readonly
Returns the value of attribute needs_recoding.
-
#pin ⇒ Object
readonly
Returns the value of attribute pin.
-
#sq_ft ⇒ Object
readonly
Returns the value of attribute sq_ft.
-
#street_name ⇒ Object
readonly
Returns the value of attribute street_name.
-
#street_number ⇒ Object
readonly
Returns the value of attribute street_number.
-
#street_type ⇒ Object
readonly
Returns the value of attribute street_type.
-
#tif_name_area ⇒ Object
readonly
Returns the value of attribute tif_name_area.
-
#ward ⇒ Object
readonly
Returns the value of attribute ward.
-
#zoning_classification ⇒ Object
readonly
Returns the value of attribute zoning_classification.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(land_api_info) ⇒ CityProperty
constructor
A new instance of CityProperty.
Constructor Details
#initialize(land_api_info) ⇒ CityProperty
Returns a new instance of CityProperty.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/chicago_owned_land.rb', line 10 def initialize(land_api_info) @direction = land_api_info["d"] @ward = land_api_info["ward"] @sq_ft = land_api_info["sq_ft"] @location = land_api_info["location"] if land_api_info["location"] @needs_recoding = land_api_info["location"]["needs_recoding"] @longitude = land_api_info["location"]["longitude"] @latitude = land_api_info["location"]["latitude"] @human_address = land_api_info["location"]["human_address"] end @tif_name_area = land_api_info["tif_name_area"] @street_name = land_api_info["street_name"] @pin = land_api_info["digit_pin"] @community_area = land_api_info["community_area"] @street_number = land_api_info["street_number"] @street_type = land_api_info["type"] @zoning_classification = land_api_info["zoning_classification"] end |
Instance Attribute Details
#community_area ⇒ Object (readonly)
Returns the value of attribute community_area.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def community_area @community_area end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def direction @direction end |
#human_address ⇒ Object (readonly)
Returns the value of attribute human_address.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def human_address @human_address end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def latitude @latitude end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def location @location end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def longitude @longitude end |
#needs_recoding ⇒ Object (readonly)
Returns the value of attribute needs_recoding.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def needs_recoding @needs_recoding end |
#pin ⇒ Object (readonly)
Returns the value of attribute pin.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def pin @pin end |
#sq_ft ⇒ Object (readonly)
Returns the value of attribute sq_ft.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def sq_ft @sq_ft end |
#street_name ⇒ Object (readonly)
Returns the value of attribute street_name.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def street_name @street_name end |
#street_number ⇒ Object (readonly)
Returns the value of attribute street_number.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def street_number @street_number end |
#street_type ⇒ Object (readonly)
Returns the value of attribute street_type.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def street_type @street_type end |
#tif_name_area ⇒ Object (readonly)
Returns the value of attribute tif_name_area.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def tif_name_area @tif_name_area end |
#ward ⇒ Object (readonly)
Returns the value of attribute ward.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def ward @ward end |
#zoning_classification ⇒ Object (readonly)
Returns the value of attribute zoning_classification.
7 8 9 |
# File 'lib/chicago_owned_land.rb', line 7 def zoning_classification @zoning_classification end |
Class Method Details
.all ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/chicago_owned_land.rb', line 30 def self.all api_array = Unirest.get('https://data.cityofchicago.org/resource/aksk-kvfp.json').body land = [] api_array.each do |land_info| land << CityProperty.new(land_info) end land end |