Class: Schoolfinder::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/schoolfinder/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_timeoutObject

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(options)
  params = {:f => 'districtSearch'}
  make_request(params, options)
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(options)
  params = {:f => 'getReviews'}
  make_request(params, options)
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(options)
  params = {:f => 'getStudentDiversity'}
  make_request(params, options)
end

#student_stats(options) ⇒ Object



53
54
55
56
# File 'lib/schoolfinder/client.rb', line 53

def student_stats(options)
  params = {:f => 'getStudentStats'}
  make_request(params, options)
end

#teacher_stats(options) ⇒ Object



48
49
50
51
# File 'lib/schoolfinder/client.rb', line 48

def teacher_stats(options)
  params = {:f => 'getTeacherStats'}
  make_request(params, options)
end

#test_rating(options) ⇒ Object



33
34
35
36
# File 'lib/schoolfinder/client.rb', line 33

def test_rating(options)
  params = {:f => 'getTestRating'}
  make_request(params, options)
end

#test_scores(options) ⇒ Object



43
44
45
46
# File 'lib/schoolfinder/client.rb', line 43

def test_scores(options)
  params = {:f => 'getTestScores'}
  make_request(params, options)
end