Class: GreatSchools::District
- Defined in:
- lib/great_schools/district.rb
Overview
GreatSchools District
– TODO: add method to grab schools using GreatSchools::School#nearby with the address
, city
, state
, and zip_code
options (parsing address). Filter results to schools with a matching district name. ++
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#charter_schools ⇒ Object
Returns the value of attribute charter_schools.
-
#district_rating ⇒ Object
Returns the value of attribute district_rating.
-
#elementary_schools ⇒ Object
Returns the value of attribute elementary_schools.
-
#fax ⇒ Object
Returns the value of attribute fax.
-
#grade_range ⇒ Object
Returns the value of attribute grade_range.
-
#high_schools ⇒ Object
Returns the value of attribute high_schools.
-
#middle_schools ⇒ Object
Returns the value of attribute middle_schools.
-
#name ⇒ Object
Returns the value of attribute name.
-
#nces_code ⇒ Object
Returns the value of attribute nces_code.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#public_schools ⇒ Object
Returns the value of attribute public_schools.
-
#total_schools ⇒ Object
Returns the value of attribute total_schools.
-
#website ⇒ Object
Returns the value of attribute website.
Class Method Summary collapse
-
.browse(state, city) ⇒ Object
Returns a list of school districts in a city.
Methods inherited from Model
Constructor Details
This class inherits a constructor from GreatSchools::Model
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
10 11 12 |
# File 'lib/great_schools/district.rb', line 10 def address @address end |
#charter_schools ⇒ Object
Returns the value of attribute charter_schools.
13 14 15 |
# File 'lib/great_schools/district.rb', line 13 def charter_schools @charter_schools end |
#district_rating ⇒ Object
Returns the value of attribute district_rating.
11 12 13 |
# File 'lib/great_schools/district.rb', line 11 def @district_rating end |
#elementary_schools ⇒ Object
Returns the value of attribute elementary_schools.
12 13 14 |
# File 'lib/great_schools/district.rb', line 12 def elementary_schools @elementary_schools end |
#fax ⇒ Object
Returns the value of attribute fax.
10 11 12 |
# File 'lib/great_schools/district.rb', line 10 def fax @fax end |
#grade_range ⇒ Object
Returns the value of attribute grade_range.
11 12 13 |
# File 'lib/great_schools/district.rb', line 11 def grade_range @grade_range end |
#high_schools ⇒ Object
Returns the value of attribute high_schools.
12 13 14 |
# File 'lib/great_schools/district.rb', line 12 def high_schools @high_schools end |
#middle_schools ⇒ Object
Returns the value of attribute middle_schools.
12 13 14 |
# File 'lib/great_schools/district.rb', line 12 def middle_schools @middle_schools end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/great_schools/district.rb', line 10 def name @name end |
#nces_code ⇒ Object
Returns the value of attribute nces_code.
11 12 13 |
# File 'lib/great_schools/district.rb', line 11 def nces_code @nces_code end |
#phone ⇒ Object
Returns the value of attribute phone.
10 11 12 |
# File 'lib/great_schools/district.rb', line 10 def phone @phone end |
#public_schools ⇒ Object
Returns the value of attribute public_schools.
13 14 15 |
# File 'lib/great_schools/district.rb', line 13 def public_schools @public_schools end |
#total_schools ⇒ Object
Returns the value of attribute total_schools.
11 12 13 |
# File 'lib/great_schools/district.rb', line 11 def total_schools @total_schools end |
#website ⇒ Object
Returns the value of attribute website.
10 11 12 |
# File 'lib/great_schools/district.rb', line 10 def website @website end |
Class Method Details
.browse(state, city) ⇒ Object
Returns a list of school districts in a city.
Attributes
-
state
- Two letter state abbreviation -
city
- Name of city
22 23 24 25 26 |
# File 'lib/great_schools/district.rb', line 22 def browse(state, city) response = GreatSchools::API.get("districts/#{state.upcase}/#{parameterize(city)}") Array.wrap(response).map { |district| new(district) } end |