gotransverse-tract-api 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: 49377ea24615a129d54a3049f9628661edba2ba7
4
- data.tar.gz: 19c363994c6319fbd2d8b469fb24cf28523856b3
3
+ metadata.gz: a256fcddce4972606eddf0e158634df4a8c9ddfd
4
+ data.tar.gz: a0761ea57d091a504088dfc6883faa777c2bb498
5
5
  SHA512:
6
- metadata.gz: e11eb9c7b2f195de8f5a6a27110973c49e92b0010e6cf757a72eff1b1bf3f6961f8dac6c0af900ca47fb52fef1a71782d11c5051b09fec52b6dab18cebeeadb4
7
- data.tar.gz: 10c70d90449a29c1d5a7eb815aab78f1e0725d828fe5c8d43e404e75abb2649b76692abcaec471a87778170e0c4225dbdec671fbbaa9cfec13e267880b514f7c
6
+ metadata.gz: 0752873f7167c7b0cbe07a6952299055fcc607b31e73e7f219bbb5d6181c2c37ee262dd00fdc9f848a64cd98c49f51311575c05f1aa7573bc0befc8a19128edc
7
+ data.tar.gz: 9d9f4e87b3d4d4eb5af8dd488ee5599caf9a25417412f31e99e43741191b18d0f18349ea1251504460a47b5fc1fc92af9e0911673f4515a5530b78300d082f3a
@@ -103,9 +103,9 @@ module GoTransverseTractApi
103
103
  # self.get_response_for
104
104
  #
105
105
  # @param {Class} klass
106
- # @param {Hash} api_params
106
+ # @param {Hash} api_params (optional)
107
107
  #
108
- def self.get_response_for(klass, api_params)
108
+ def self.get_response_for(klass, api_params={})
109
109
 
110
110
  api_url = GoTransverseTractApi.get_api_url_for(klass)
111
111
 
@@ -121,9 +121,9 @@ module GoTransverseTractApi
121
121
  # self.post_request_for
122
122
  #
123
123
  # @param {Class} klass
124
- # @param {Hash} api_params
124
+ # @param {Hash} api_params (optional)
125
125
  #
126
- def self.post_request_for(klass, api_params)
126
+ def self.post_request_for(klass, api_params={})
127
127
  api_url = GoTransverseTractApi.get_api_url_for(klass)
128
128
  self.call(api_url, api_params, :post)
129
129
  end
@@ -132,9 +132,9 @@ module GoTransverseTractApi
132
132
  # self.put_request_for
133
133
  #
134
134
  # @param {Class} klass
135
- # @param {Hash} api_params
135
+ # @param {Hash} api_params (optional)
136
136
  #
137
- def self.put_request_for(klass, api_params)
137
+ def self.put_request_for(klass, api_params={})
138
138
  api_url = GoTransverseTractApi.get_api_url_for(klass)
139
139
  self.call(api_url, api_params, :put)
140
140
  end
@@ -152,9 +152,9 @@ module GoTransverseTractApi
152
152
  # self.get_cached_response_for
153
153
  #
154
154
  # @param {Class} klass
155
- # @param {Hash} api_params
155
+ # @param {Hash} api_params (optional)
156
156
  #
157
- def self.get_cached_response_for(klass, api_params)
157
+ def self.get_cached_response_for(klass, api_params={})
158
158
  key = "#{klass.classname}.#{api_params.sort}"
159
159
 
160
160
  return Rails.cache.fetch(key, expires_in: 10.minutes) do
@@ -168,13 +168,15 @@ module GoTransverseTractApi
168
168
  # self.call
169
169
  #
170
170
  # @param {String} api_url
171
- # @param {Hash} api_params
171
+ # @param {Hash} api_params (optional)
172
172
  # @param {String} method (optional)
173
173
  #
174
- def self.call(api_url, api_params, method=:get)
174
+ def self.call(api_url, api_params={}, method=:get)
175
175
 
176
176
  headers = self.get_authentication_headers
177
177
 
178
+ # TODO: Recursively camelize all keys in api_params Hash.
179
+
178
180
  http_client = HTTPClient.new
179
181
  case method
180
182
  when :get
@@ -1,6 +1,6 @@
1
1
  module GoTransverseTractApi
2
2
 
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  TARGET_API_VERSION = "1.19"
5
5
 
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gotransverse-tract-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien DeFrance