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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bbe4042650b2bf9d46f15e0dfa32963c529a4ffecdeb15ccae14cf11980cda64
4
- data.tar.gz: 431c3ea4fdd09064d1a806638f3a8f14870aa403361e688e264bca3ba4ccd31b
3
+ metadata.gz: 401505886d0035377498198d8d1b6776e3145922e45cda5e4e1b432929c25e8d
4
+ data.tar.gz: 2b63de56bae3d3b64455f3144fdc53eeebed8d291677d17ac7a514f60db1cd95
5
5
  SHA512:
6
- metadata.gz: c2c5f41d6955ed71cf0bf51b9299f5cb6dc534f6c3e58f3635b9d9f643c54e61eaadcee81cc2910ac25d3a116a90da477a842a42f7bac96e36160c3acc678fe3
7
- data.tar.gz: 508cbc194555551151b7c3b08ec0f5901402a8af2f218a55aa35d971463c5014c39b2e978e0f82604e682ca593011d21f2c348c6c4245898310f1d5380685605
6
+ metadata.gz: e3e90df3d4e5d1e99be79cc7d763df1fd43ff67ad167d4d66ab2d3c390a75df16bc638f9407eec2ec2ce9259002c463a74a061d06ab6395ce170023db76d5ade
7
+ data.tar.gz: 87521baa673557e7bb53710d8ae0418eb9cc24a1e3d7695d15b42744eccdfdfe06a357e601933ce8f82d0f700619c6157ca223a6e50700397ebe9ed9bc1f5899
@@ -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 boxLatitudeNW boxLongitudeNW boxLatitudeSE boxLongitudeSE returnCount)
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
- def school_digger_api_version
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#{school_digger_api_version}"
121
+ @school_digger_url_base ||= "#{school_digger_url_endpoint}/v#{api_version}"
120
122
  end
121
123
 
122
-
123
124
  end
124
125
  end
@@ -1,3 +1,3 @@
1
1
  module SchoolDigger
2
- VERSION = "1.2.0"
2
+ VERSION = "2.1.0"
3
3
  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.2.0
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: 2022-11-29 00:00:00.000000000 Z
11
+ date: 2024-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler