vindi 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 6b6a28994b0f5108cc5c11887854de4db578eddb
4
- data.tar.gz: 9c77d88efb1d79de6abc352bc25a2a633a920a5d
3
+ metadata.gz: aa9ad99820c63edef8c56003e328dd221ce994cd
4
+ data.tar.gz: 834423a9ffabfad33678cf29fae92cb371e4ede2
5
5
  SHA512:
6
- metadata.gz: 7b470b6602760c7787bcd5b53b77651cff3e0043f368a8a2d02cefa54d88fb967f67beeeb71f59fafca5c94553383b744fad104c78b6e67b9edf51b3d554baf4
7
- data.tar.gz: c22faffb32cfe3dd9be3cf98916c6eb8c1495e64fad00faa46d41bcb2d19035f6a21dfc2d097ad2d3432ca7428d3df637d44eda12614673f64c80e2f27065963
6
+ metadata.gz: b6d6f22cba50f50a2ca96eb6d99e78555c8699af0feafac40ab6eba87ca4bc2da665ee2bcd0d842df6a1ad6cd37dd0ed4c53cc7c3ba63c876f95db2412f05d8f
7
+ data.tar.gz: b59bbdcaa255677a7d964a0bc57f0b24c42606031b2ca7051587d29d7720a0ec8c6b0c553bda78f62cdfcf120f6958559b30b5d608b2a53b9ade55cd0022fa01
data/README.md CHANGED
@@ -7,7 +7,7 @@ Ruby toolkit para a [API de Recorrência][link-introducao-api] da [Vindi][link-v
7
7
  ## Instalação
8
8
 
9
9
  ```ruby
10
- gem 'vindi-ruby'
10
+ gem 'vindi'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -16,7 +16,7 @@ And then execute:
16
16
 
17
17
  Or install it yourself as:
18
18
 
19
- $ gem install vindi-ruby
19
+ $ gem install vindi
20
20
 
21
21
  ## Uso
22
22
  Os métodos da API estão disponíveis atraves dos métodos da instancia de um cliente
@@ -42,24 +42,24 @@ module Vindi
42
42
  def from_response(response)
43
43
  status = response.status.to_i
44
44
 
45
- if klass = case status
46
- when 400 then Vindi::Error::BadRequest
47
- when 401 then Vindi::Error::Unauthorized
48
- when 403 then Vindi::Error::Forbidden
49
- when 404 then Vindi::Error::NotFound
50
- when 406 then Vindi::Error::NotAcceptable
51
- when 415 then Vindi::Error::UnsupportedMediaType
52
- when 422 then Vindi::Error::UnprocessableEntity
53
- when 429 then Vindi::Error::TooManyRequests
54
- when 400..499 then Vindi::Error::ClientError
55
- when 500 then Vindi::Error::InternalServerError
56
- when 502 then Vindi::Error::BadGateway
57
- when 503 then Vindi::Error::ServiceUnavailable
58
- when 504 then Vindi::Error::GatewayTimeout
59
- when 500..599 then Vindi::Error::ServerError
60
- end
61
- klass.new(response) if klass
62
- end
45
+ klass = case status
46
+ when 400 then Vindi::Error::BadRequest
47
+ when 401 then Vindi::Error::Unauthorized
48
+ when 403 then Vindi::Error::Forbidden
49
+ when 404 then Vindi::Error::NotFound
50
+ when 406 then Vindi::Error::NotAcceptable
51
+ when 415 then Vindi::Error::UnsupportedMediaType
52
+ when 422 then Vindi::Error::UnprocessableEntity
53
+ when 429 then Vindi::Error::TooManyRequests
54
+ when 400..499 then Vindi::Error::ClientError
55
+ when 500 then Vindi::Error::InternalServerError
56
+ when 502 then Vindi::Error::BadGateway
57
+ when 503 then Vindi::Error::ServiceUnavailable
58
+ when 504 then Vindi::Error::GatewayTimeout
59
+ when 500..599 then Vindi::Error::ServerError
60
+ end
61
+
62
+ klass.new(response) if klass
63
63
  end
64
64
  end
65
65
 
@@ -3,16 +3,15 @@ require 'vindi/error'
3
3
 
4
4
  module Vindi
5
5
  module Response
6
-
6
+
7
7
  # This class raises exceptions based HTTP status codes retuned by the API
8
8
  class RaiseError < Faraday::Response::Middleware
9
9
 
10
10
  private
11
11
 
12
12
  def on_complete(response)
13
- if error = Vindi::Error.from_response(response)
14
- raise error
15
- end
13
+ error = Vindi::Error.from_response(response)
14
+ raise error if error
16
15
  end
17
16
  end
18
17
  end
@@ -1,3 +1,3 @@
1
1
  module Vindi
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vindi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vindi