school_digger 1.2.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/school_digger/api.rb +12 -11
- data/lib/school_digger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 401505886d0035377498198d8d1b6776e3145922e45cda5e4e1b432929c25e8d
|
4
|
+
data.tar.gz: 2b63de56bae3d3b64455f3144fdc53eeebed8d291677d17ac7a514f60db1cd95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3e90df3d4e5d1e99be79cc7d763df1fd43ff67ad167d4d66ab2d3c390a75df16bc638f9407eec2ec2ce9259002c463a74a061d06ab6395ce170023db76d5ade
|
7
|
+
data.tar.gz: 87521baa673557e7bb53710d8ae0418eb9cc24a1e3d7695d15b42744eccdfdfe06a357e601933ce8f82d0f700619c6157ca223a6e50700397ebe9ed9bc1f5899
|
data/lib/school_digger/api.rb
CHANGED
@@ -3,11 +3,12 @@ module SchoolDigger
|
|
3
3
|
|
4
4
|
include HTTParty
|
5
5
|
|
6
|
-
attr_reader :app_id, :app_key
|
7
|
-
|
6
|
+
attr_reader :app_id, :app_key, :api_version
|
7
|
+
|
8
8
|
def initialize(options = {})
|
9
9
|
@app_id = options.fetch(:app_id, default_app_id)
|
10
10
|
@app_key = options.fetch(:app_key, default_app_key)
|
11
|
+
@api_version = options.fetch(:api_version, default_api_version)
|
11
12
|
end
|
12
13
|
|
13
14
|
def get(path, query = {})
|
@@ -16,7 +17,7 @@ module SchoolDigger
|
|
16
17
|
|
17
18
|
# # SchoolDigger::Api.new.autocomplete('San Die', st: "CA")
|
18
19
|
def autocomplete(query, options = {} )
|
19
|
-
available_options = %w(q st level
|
20
|
+
available_options = %w(q st level eSE boxLongitudeSE returnCount)
|
20
21
|
options = options.select {|k,v| available_options.include?(k.to_s)}
|
21
22
|
options[:q] = query
|
22
23
|
get "/autocomplete/schools", options
|
@@ -99,26 +100,26 @@ module SchoolDigger
|
|
99
100
|
default_params.merge query
|
100
101
|
end
|
101
102
|
|
102
|
-
def default_app_id
|
103
|
+
def default_app_id
|
103
104
|
ENV.fetch("SCHOOL_DIGGER_APP_ID", 'not-implemented')
|
104
105
|
end
|
105
106
|
|
106
|
-
def default_app_key
|
107
|
+
def default_app_key
|
107
108
|
ENV.fetch("SCHOOL_DIGGER_APP_KEY", 'not-implemented')
|
108
109
|
end
|
109
110
|
|
111
|
+
def default_api_version
|
112
|
+
ENV.fetch("SCHOOL_DIGGER_API_VERSION", "1.1")
|
113
|
+
end
|
114
|
+
|
110
115
|
def school_digger_url_endpoint
|
111
116
|
@school_digger_url_endpoint ||= ENV.fetch("SCHOOL_DIGGER_BASE_URL", "https://api.schooldigger.com")
|
112
117
|
end
|
113
118
|
|
114
|
-
|
115
|
-
@school_digger_api_version ||= ENV.fetch("SCHOOL_DIGGER_API_VERSION", "1.1")
|
116
|
-
end
|
117
|
-
|
119
|
+
|
118
120
|
def school_digger_url_base
|
119
|
-
@school_digger_url_base ||= "#{school_digger_url_endpoint}/v#{
|
121
|
+
@school_digger_url_base ||= "#{school_digger_url_endpoint}/v#{api_version}"
|
120
122
|
end
|
121
123
|
|
122
|
-
|
123
124
|
end
|
124
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: school_digger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|