Class: Concensus::School::Secondary

Inherits:
Concensus::School show all
Defined in:
lib/concensus/school.rb

Instance Attribute Summary

Attributes inherited from Resource

#geometry, #name, #state, #year

Class Method Summary collapse

Methods inherited from Resource

already_unzipped?, file_extension, filename_without_extension, get_and_unzip, #initialize, process_find, state_code_to_id

Constructor Details

This class inherits a constructor from Concensus::Resource

Class Method Details

.find(state, name = nil) ⇒ Object


23
24
25
26
27
28
29
30
31
32
33
# File 'lib/concensus/school.rb', line 23

def self.find(state, name = nil)
  if Concensus::configuration.year == 2010
    attribute_key = "NAME10"
    shp_file_path = get_and_unzip("SCSD/2010/tl_2010_#{state_code_to_id(state)}_scsd10.zip")
  elsif Concensus::configuration.year == 2011
    attribute_key = "name"
    shp_file_path = get_and_unzip("SCSD/tl_2011_#{state_code_to_id(state)}_scsd.zip")
  end
  
  return process_find("School::Secondary", shp_file_path, attribute_key, state, name)  
end

.find_all(state) ⇒ Object


35
36
37
# File 'lib/concensus/school.rb', line 35

def self.find_all(state)
  find(state)       
end