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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e17d65c5f2e6d411c45766286bf6039fddad144fdc7efec6434baefa2a020bd
4
- data.tar.gz: b378e9e8744b795af44d9ac22c44de8b3a800456aab8b3d8535969aa550087e8
3
+ metadata.gz: 5abbac302f1e78b3cd7d85af1eb3b623591b501beb04930474c54c67d55b678f
4
+ data.tar.gz: 9424beef4668cc476ed75eceb780e782510a317dd7df1e680e1e17a2e01cbec3
5
5
  SHA512:
6
- metadata.gz: 5f2da22d80b14f86adbe24d7ccdf7fa46ddea8a06b4a5c385e0468a579ca2a77cd977bc17c88eda3c30807d6df3f1e721bf7acb4647c7b376b148362c6044bec
7
- data.tar.gz: 4f0938c6c90f014454dd64916abfe99d6fd986c20710bd2d718bce33285963c10b05efc566996e842d8ac4513a8ca7d89bd111cb99e62a7e27f581db3225ef5c
6
+ metadata.gz: 5c29bbcde61a172c94f504b8df68644b1c36ed74ee7bbbfcc18fda5f841ba63d5e3e16bbf73e9d11ee99d15574991ad03282e7d7352ed0e8b9efca89326b387d
7
+ data.tar.gz: 488bade14b09f5d2cbf691511657b7a4870a334e1d3e1ee0f5ee4d1dcd2c0ec3aadc201f84b026cf95b00723e0ac3d21ec1b781d48c41d37739b89cd41894820
@@ -1,12 +1,10 @@
1
1
  module SchoolDigger
2
2
  class Api
3
- SCHOOL_DIGGER_URL_ENDPOINT = ENV.fetch("SCHOOL_DIGGER_BASE_URL", "https://api.schooldigger.com")
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(SCHOOL_DIGGER_URL_BASE + path, query: modify_query(query), timeout: 30)
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
@@ -1,3 +1,3 @@
1
1
  module SchoolDigger
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: school_digger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett