Class: GreatSchools::Census
Overview
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)
Instance Attribute Summary collapse
-
#address ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++. -
#district ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++. -
#enrollment ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++. -
#ethnicities ⇒ Object
Returns the value of attribute ethnicities.
-
#free_and_reduced_price_lunch ⇒ Object
Returns the value of attribute free_and_reduced_price_lunch.
-
#latitude ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++. -
#longitude ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++. -
#phone ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++. -
#school_name ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++. -
#student_teacher_ratio ⇒ Object
Returns the value of attribute student_teacher_ratio.
-
#type ⇒ Object
– NOTE: these are all
GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++.
Class Method Summary collapse
-
.for_school(state, id) ⇒ Object
Returns census and profile data for a school.
Methods inherited from Model
Constructor Details
This class inherits a constructor from GreatSchools::Model
Instance Attribute Details
#address ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def address @address end |
#district ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def district @district end |
#enrollment ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def enrollment @enrollment end |
#ethnicities ⇒ Object
Returns the value of attribute ethnicities.
17 18 19 |
# File 'lib/great_schools/census.rb', line 17 def ethnicities @ethnicities end |
#free_and_reduced_price_lunch ⇒ Object
Returns the value of attribute free_and_reduced_price_lunch.
17 18 19 |
# File 'lib/great_schools/census.rb', line 17 def free_and_reduced_price_lunch @free_and_reduced_price_lunch end |
#latitude ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def latitude @latitude end |
#longitude ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def longitude @longitude end |
#phone ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def phone @phone end |
#school_name ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def school_name @school_name end |
#student_teacher_ratio ⇒ Object
Returns the value of attribute student_teacher_ratio.
17 18 19 |
# File 'lib/great_schools/census.rb', line 17 def student_teacher_ratio @student_teacher_ratio end |
#type ⇒ Object
– NOTE: these are all GreatSchool::School
attributes, should we build a school model instead of attaching these attributes? ++
15 16 17 |
# File 'lib/great_schools/census.rb', line 15 def type @type end |
Class Method Details
.for_school(state, id) ⇒ Object
Returns census and profile data for a school.
Attributes
-
state
- Two letter state abbreviation -
id
- Numeric id of a school. This GreatSchools ID is included inother listing requests like +GreatSchools::School#browse+ and +GreatSchools::School#nearby+
28 29 30 31 32 |
# 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 |