school_digger 1.0.1 → 1.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 +16 -4
- data/lib/school_digger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5abbac302f1e78b3cd7d85af1eb3b623591b501beb04930474c54c67d55b678f
|
4
|
+
data.tar.gz: 9424beef4668cc476ed75eceb780e782510a317dd7df1e680e1e17a2e01cbec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c29bbcde61a172c94f504b8df68644b1c36ed74ee7bbbfcc18fda5f841ba63d5e3e16bbf73e9d11ee99d15574991ad03282e7d7352ed0e8b9efca89326b387d
|
7
|
+
data.tar.gz: 488bade14b09f5d2cbf691511657b7a4870a334e1d3e1ee0f5ee4d1dcd2c0ec3aadc201f84b026cf95b00723e0ac3d21ec1b781d48c41d37739b89cd41894820
|
data/lib/school_digger/api.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
module SchoolDigger
|
2
2
|
class Api
|
3
|
-
|
4
|
-
SCHOOL_DIGGER_API_VERSION = ENV.fetch("SCHOOL_DIGGER_API_VERSION", "1.1")
|
5
|
-
SCHOOL_DIGGER_URL_BASE = "#{SCHOOL_DIGGER_URL_ENDPOINT}/v#{SCHOOL_DIGGER_API_VERSION}"
|
3
|
+
|
6
4
|
include HTTParty
|
7
5
|
|
8
6
|
def get(path, query = {})
|
9
|
-
response = self.class.get(
|
7
|
+
response = self.class.get(school_digger_url_base + path, query: modify_query(query), timeout: 30)
|
10
8
|
end
|
11
9
|
|
12
10
|
# # SchoolDigger::Api.new.autocomplete('San Die', st: "CA")
|
@@ -94,5 +92,19 @@ module SchoolDigger
|
|
94
92
|
default_params.merge query
|
95
93
|
end
|
96
94
|
|
95
|
+
|
96
|
+
def school_digger_url_endpoint
|
97
|
+
@school_digger_url_endpoint ||= ENV.fetch("SCHOOL_DIGGER_BASE_URL", "https://api.schooldigger.com")
|
98
|
+
end
|
99
|
+
|
100
|
+
def school_digger_api_version
|
101
|
+
@school_digger_api_version ||= ENV.fetch("SCHOOL_DIGGER_API_VERSION", "1.1")
|
102
|
+
end
|
103
|
+
|
104
|
+
def school_digger_url_base
|
105
|
+
@school_digger_url_base ||= "#{school_digger_url_endpoint}/v#{school_digger_api_version}"
|
106
|
+
end
|
107
|
+
|
108
|
+
|
97
109
|
end
|
98
110
|
end
|