class GreatSchools::Census
School
Census
and Profile Data¶ ↑
While you can pull census data for a school manually, I'd recommend going through the school model and letting it make the call for you:
schools = GreatSchools::School.browse('CA', 'San Mateo') school = schools.first school.census # equivalent to: GreatSchools::Census.for_school(school.state, school.id)
Attributes
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
Public Class Methods
Returns census and profile data for a school.
Attributes¶ ↑
-
state
- Two letter state abbreviation -
id
- Numeric id of a school. ThisGreatSchools
ID is included inother listing requests like +GreatSchools::School#browse+ and +GreatSchools::School#nearby+
# File lib/great_schools/census.rb, line 28 def for_school(state, id) response = GreatSchools::API.get("school/census/#{state.upcase}/#{id}") new(response) end
Public Instance Methods
Set an array of GreatSchools::Ethnicity
.
Attributes¶ ↑
-
params
- aHash
orArray
ofGreatSchools::Ethnicity
attributes.
# File lib/great_schools/census.rb, line 40 def ethnicities=(params) @ethnicities = [] params = params['ethnicity'] if params.is_a?(Hash) && params.key?('ethnicity') Array.wrap(params).each do |hash| @ethnicities << GreatSchools::Ethnicity.new(hash) end @ethnicities end