Class: ChicagoOwnedLand::CityProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/chicago_owned_land.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_areaObject (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

#directionObject (readonly)

Returns the value of attribute direction.



7
8
9
# File 'lib/chicago_owned_land.rb', line 7

def direction
  @direction
end

#human_addressObject (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

#latitudeObject (readonly)

Returns the value of attribute latitude.



7
8
9
# File 'lib/chicago_owned_land.rb', line 7

def latitude
  @latitude
end

#locationObject (readonly)

Returns the value of attribute location.



7
8
9
# File 'lib/chicago_owned_land.rb', line 7

def location
  @location
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



7
8
9
# File 'lib/chicago_owned_land.rb', line 7

def longitude
  @longitude
end

#needs_recodingObject (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

#pinObject (readonly)

Returns the value of attribute pin.



7
8
9
# File 'lib/chicago_owned_land.rb', line 7

def pin
  @pin
end

#sq_ftObject (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_nameObject (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_numberObject (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_typeObject (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_areaObject (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

#wardObject (readonly)

Returns the value of attribute ward.



7
8
9
# File 'lib/chicago_owned_land.rb', line 7

def ward
  @ward
end

#zoning_classificationObject (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

.allObject



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