myinfo 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6726edb186a85078a81f2c35be0dc47020964f657c610df9c72c687fa77bd7d3
4
- data.tar.gz: 6e56e1209674511a2b01c134167db37873ca98d7f9ef70cffd780a2c8d0774c5
3
+ metadata.gz: ed7daa60be9cb221ff90dc1df8138351c74339935e1c20aaf072924733ba95ee
4
+ data.tar.gz: 330f5df3d40c7fcf71e4a688f88b9994bfc212ca4834b896ff41d48e8fb0f41e
5
5
  SHA512:
6
- metadata.gz: 27e06e298637b5c688da1325ce5eabae97617d2144188dba805e369035b727b0d618014f60b8b41ddb900f406017f958bab05cc5a378d9ee2834dfe61d96def8
7
- data.tar.gz: 53f7cfa76b70966b945e8a3783f82a9181144104908eba44d1ef289f4c31b22b2fe5e41da3b2ad0deae970d5fba6c7917de05d012dccca59f65615708d49d699
6
+ metadata.gz: 2921ef5121d5b616287eb6eacb914d3fa3288122079b89b0bf94d250f3b64a7f868dc7cd4f2da93d5be33f403caa0e42036d515d31af1e7ee59cfc561d458f5d
7
+ data.tar.gz: 7fd25c754e169fc8f4ea5d80c464cd2520463ed226f8046270c222a215ffe3217d5b920d4c6875ab114168f05cb6dce1b805b48328a03df4bbb26bddd7a22180
data/lib/myinfo/v3/api.rb CHANGED
@@ -17,12 +17,6 @@ module MyInfo
17
17
  raise NotImplementedError, 'abstract'
18
18
  end
19
19
 
20
- def call
21
- yield
22
- rescue StandardError => e
23
- Response.new(success: false, data: e)
24
- end
25
-
26
20
  def slug
27
21
  ''
28
22
  end
@@ -14,13 +14,11 @@ module MyInfo
14
14
  end
15
15
 
16
16
  def call
17
- super do
18
- headers = header(params: params, access_token: access_token)
19
- endpoint_url = "/#{slug}?#{params.to_query}"
17
+ headers = header(params: params, access_token: access_token)
18
+ endpoint_url = "/#{slug}?#{params.to_query}"
20
19
 
21
- response = http.request_get(endpoint_url, headers)
22
- parse_response(response)
23
- end
20
+ response = http.request_get(endpoint_url, headers)
21
+ parse_response(response)
24
22
  end
25
23
 
26
24
  def slug
@@ -15,13 +15,11 @@ module MyInfo
15
15
  end
16
16
 
17
17
  def call
18
- super do
19
- headers = header(params: params)
20
- endpoint_url = "/#{slug}?#{params.to_query}"
18
+ headers = header(params: params)
19
+ endpoint_url = "/#{slug}?#{params.to_query}"
21
20
 
22
- response = http.request_get(endpoint_url, headers)
23
- parse_response(response)
24
- end
21
+ response = http.request_get(endpoint_url, headers)
22
+ parse_response(response)
25
23
  end
26
24
 
27
25
  def slug
@@ -15,12 +15,8 @@ module MyInfo
15
15
  @success
16
16
  end
17
17
 
18
- def exception?
19
- data.is_a?(StandardError)
20
- end
21
-
22
18
  def to_s
23
- exception? ? data.message : data
19
+ data
24
20
  end
25
21
  end
26
22
  end
@@ -12,12 +12,10 @@ module MyInfo
12
12
  end
13
13
 
14
14
  def call
15
- super do
16
- headers = header(params: params).merge({ 'Content-Type' => 'application/x-www-form-urlencoded' })
17
- response = http.request_post("/#{slug}", params.to_param, headers)
15
+ headers = header(params: params).merge({ 'Content-Type' => 'application/x-www-form-urlencoded' })
16
+ response = http.request_post("/#{slug}", params.to_param, headers)
18
17
 
19
- parse_response(response)
20
- end
18
+ parse_response(response)
21
19
  end
22
20
 
23
21
  def http_method
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MyInfo
4
+ module Version
5
+ WRAPPER_VERSION = '0.4.0'
6
+ end
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lim Yao Jie
@@ -153,6 +153,7 @@ files:
153
153
  - lib/myinfo/v3/person_basic.rb
154
154
  - lib/myinfo/v3/response.rb
155
155
  - lib/myinfo/v3/token.rb
156
+ - lib/myinfo/version.rb
156
157
  homepage: https://github.com/GovTechSG/myinfo-rails
157
158
  licenses:
158
159
  - MIT