Class: Schoolfinder::Client
- Inherits:
-
Object
- Object
- Schoolfinder::Client
- Includes:
- HTTParty
- Defined in:
- lib/schoolfinder/client.rb
Instance Attribute Summary collapse
-
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
Instance Method Summary collapse
- #assigned_district(optional_params = {}) ⇒ Object
- #assigned_schools(optional_params = {}) ⇒ Object
- #branding_data(optional_params = {}) ⇒ Object
- #district_search(options) ⇒ Object
-
#initialize(api_key, http_timeout = nil) ⇒ Client
constructor
A new instance of Client.
- #number_of(city, state) ⇒ Object
- #reviews(options) ⇒ Object
- #school_search(optional_params = {}) ⇒ Object
- #student_diversity(options) ⇒ Object
- #student_stats(options) ⇒ Object
- #teacher_stats(options) ⇒ Object
- #test_rating(options) ⇒ Object
- #test_scores(options) ⇒ Object
Constructor Details
#initialize(api_key, http_timeout = nil) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 |
# File 'lib/schoolfinder/client.rb', line 10 def initialize(api_key, http_timeout = nil) self.class.default_params :key => api_key self.class.default_params :sn => 'sf' self.class.default_params :resf => 'json' self.class.default_params :v => '5' self.http_timeout = http_timeout end |
Instance Attribute Details
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
8 9 10 |
# File 'lib/schoolfinder/client.rb', line 8 def http_timeout @http_timeout end |
Instance Method Details
#assigned_district(optional_params = {}) ⇒ Object
28 29 30 31 |
# File 'lib/schoolfinder/client.rb', line 28 def assigned_district(optional_params = {}) params = {:f => 'getAssignedDistrict'} make_request(params, optional_params) end |
#assigned_schools(optional_params = {}) ⇒ Object
23 24 25 26 |
# File 'lib/schoolfinder/client.rb', line 23 def assigned_schools(optional_params = {}) params = {:f => 'getAssignedSchools'} make_request(params, optional_params) end |
#branding_data(optional_params = {}) ⇒ Object
73 74 75 76 |
# File 'lib/schoolfinder/client.rb', line 73 def branding_data(optional_params = {}) params = {:f => 'gbd'} make_request(params, optional_params) end |
#district_search(options) ⇒ Object
68 69 70 71 |
# File 'lib/schoolfinder/client.rb', line 68 def district_search() params = {:f => 'districtSearch'} make_request(params, ) end |
#number_of(city, state) ⇒ Object
63 64 65 66 |
# File 'lib/schoolfinder/client.rb', line 63 def number_of(city, state) params = {:f => 'numberOf', :city => city, :state => state} make_request(params) end |
#reviews(options) ⇒ Object
58 59 60 61 |
# File 'lib/schoolfinder/client.rb', line 58 def reviews() params = {:f => 'getReviews'} make_request(params, ) end |
#school_search(optional_params = {}) ⇒ Object
18 19 20 21 |
# File 'lib/schoolfinder/client.rb', line 18 def school_search(optional_params = {}) params = {:f => 'schoolSearch'} make_request(params, optional_params) end |
#student_diversity(options) ⇒ Object
38 39 40 41 |
# File 'lib/schoolfinder/client.rb', line 38 def student_diversity() params = {:f => 'getStudentDiversity'} make_request(params, ) end |
#student_stats(options) ⇒ Object
53 54 55 56 |
# File 'lib/schoolfinder/client.rb', line 53 def student_stats() params = {:f => 'getStudentStats'} make_request(params, ) end |
#teacher_stats(options) ⇒ Object
48 49 50 51 |
# File 'lib/schoolfinder/client.rb', line 48 def teacher_stats() params = {:f => 'getTeacherStats'} make_request(params, ) end |
#test_rating(options) ⇒ Object
33 34 35 36 |
# File 'lib/schoolfinder/client.rb', line 33 def () params = {:f => 'getTestRating'} make_request(params, ) end |
#test_scores(options) ⇒ Object
43 44 45 46 |
# File 'lib/schoolfinder/client.rb', line 43 def test_scores() params = {:f => 'getTestScores'} make_request(params, ) end |