Sha256: 0031a41273a0abab93ad44256a34cb7fbe9c82987713fa55441cc42eb15ccefc
Contents?: true
Size: 1000 Bytes
Versions: 6
Compression:
Stored size: 1000 Bytes
Contents
module GreatSchools # :nodoc: # = 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. # ++ class District < Model attr_accessor :name, :address, :phone, :fax, :website attr_accessor :nces_code, :district_rating, :grade_range, :total_schools attr_accessor :elementary_schools, :middle_schools, :high_schools attr_accessor :public_schools, :charter_schools class << self # Class methods # Returns a list of school districts in a city. # # ==== Attributes # # * +state+ - Two letter state abbreviation # * +city+ - Name of city def browse(state, city) response = GreatSchools::API.get("districts/#{state.upcase}/#{parameterize(city)}") Array.wrap(response).map { |district| new(district) } end end end end
Version data entries
6 entries across 6 versions & 1 rubygems