vindi 0.0.2 → 0.0.3

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
- SHA1:
3
- metadata.gz: aa9ad99820c63edef8c56003e328dd221ce994cd
4
- data.tar.gz: 834423a9ffabfad33678cf29fae92cb371e4ede2
2
+ SHA256:
3
+ metadata.gz: 6324f066d5adb684494d274974aa86e071128aab06ad39014a483a88ef0c1fd6
4
+ data.tar.gz: ae3e8560d9ba75e01538a1b976146314f10fe0d3e4b5cbd4bd4b66edecc9b192
5
5
  SHA512:
6
- metadata.gz: b6d6f22cba50f50a2ca96eb6d99e78555c8699af0feafac40ab6eba87ca4bc2da665ee2bcd0d842df6a1ad6cd37dd0ed4c53cc7c3ba63c876f95db2412f05d8f
7
- data.tar.gz: b59bbdcaa255677a7d964a0bc57f0b24c42606031b2ca7051587d29d7720a0ec8c6b0c553bda78f62cdfcf120f6958559b30b5d608b2a53b9ade55cd0022fa01
6
+ metadata.gz: a777cac742e07701ff22fe1f7bb6d60f852e60f572dce5efbec0d66c2b10d91b802a94661c6a11d3d2dde7a6b2f5dcdd853daa5d587702c35ffc3714e81c1853
7
+ data.tar.gz: 56b6a34da4b7bfc956a1cd347a82a8b5a4b5401a94b72342486e0be37470cf9f323b130de45c20a85a227ba18fab81f08485a9a7214720da5e1e8fb084c8c317
data/README.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # Vindi Ruby
2
2
 
3
+ [![Build Status](https://semaphoreci.com/api/v1/projects/48986e75-f1a3-4ca3-ae41-2d6cf64ac507/1512354/badge.svg)](https://semaphoreci.com/vindi/vindi-ruby)
4
+
5
+ ## Descrição
6
+
3
7
  Ruby toolkit para a [API de Recorrência][link-introducao-api] da [Vindi][link-vindi].
4
8
 
5
- [![Build Status](https://semaphoreci.com/api/v1/projects/48986e75-f1a3-4ca3-ae41-2d6cf64ac507/1512354/badge.svg)](https://semaphoreci.com/vindi/vindi-ruby)
9
+ ## Requisitos
10
+
11
+ * Ruby >=2.3;
12
+ * Certificado digital HTTPS assinado por uma entidade certificadora;
13
+ * Conta ativa na [Vindi](https://www.vindi.com.br).
6
14
 
7
15
  ## Instalação
8
16
 
@@ -10,11 +18,11 @@ Ruby toolkit para a [API de Recorrência][link-introducao-api] da [Vindi][link-v
10
18
  gem 'vindi'
11
19
  ```
12
20
 
13
- And then execute:
21
+ Então execute:
14
22
 
15
23
  $ bundle
16
24
 
17
- Or install it yourself as:
25
+ Ou instale você mesmo:
18
26
 
19
27
  $ gem install vindi
20
28
 
@@ -23,10 +31,10 @@ Os métodos da API estão disponíveis atraves dos métodos da instancia de um c
23
31
 
24
32
  ```ruby
25
33
  client = Vindi::Client.new(key: 'VINDI_KEY')
26
- ```
34
+ ```
27
35
 
28
36
  ### Consumindo recursos
29
- Os recursos são fornecidos através do objeto de retono e os campos retornados podem ser acessados pela notação de attributos de um Hash
37
+ Os recursos são fornecidos através do objeto de retorno e os campos retornados podem ser acessados pela notação de attributos de um Hash
30
38
 
31
39
  ```ruby
32
40
  # Listando planos de um lojista
@@ -43,7 +51,7 @@ Os recursos são fornecidos através do objeto de retono e os campos retornados
43
51
 
44
52
  # Criando um plano
45
53
  client.create_plan({name: 'My new plan', interval: 'months', interval_count: 1, billing_trigger_type: 'beginning_of_period'})
46
- ```
54
+ ```
47
55
 
48
56
  ### Acessando respostas HTTP
49
57
 
@@ -51,7 +59,7 @@ Os recursos são fornecidos através do objeto de retono e os campos retornados
51
59
  client.list_plans
52
60
  response = client.last_response
53
61
  status = response.status
54
- ```
62
+ ```
55
63
 
56
64
  ## Dúvidas
57
65
  Caso necessite de informações sobre a plataforma ou API, por favor acesse o [Atendimento Vindi](http://atendimento.vindi.com.br/hc/pt-br).
@@ -1,6 +1,7 @@
1
1
  module Vindi
2
2
  # Custom error class for rescuing from all Vindi errors
3
3
  class Error < StandardError
4
+ attr_accessor :status_code
4
5
 
5
6
  # Raised when Vindi returns a 4xx HTTP status code
6
7
  ClientError = Class.new(self)
@@ -68,10 +69,11 @@ module Vindi
68
69
  end
69
70
 
70
71
  def build_error_message(response)
71
- return if response.nil?
72
+ return unless response&.body
72
73
 
73
- message = "#{response[:method].to_s.upcase} "
74
- message
74
+ self.status_code = response.status
75
+
76
+ response.body
75
77
  end
76
78
  end
77
79
  end
@@ -1,3 +1,3 @@
1
1
  module Vindi
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -16,6 +16,6 @@ Gem::Specification.new do |spec|
16
16
  spec.require_paths = ["lib"]
17
17
 
18
18
  spec.add_dependency 'faraday', '~> 0.13.1'
19
- spec.add_development_dependency "bundler", "~> 1.15"
19
+ spec.add_development_dependency "bundler"
20
20
  spec.add_development_dependency "rake", "~> 10.0"
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vindi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vindi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-12 00:00:00.000000000 Z
11
+ date: 2019-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.15'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.15'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -113,8 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.6.13
116
+ rubygems_version: 3.0.2
118
117
  signing_key:
119
118
  specification_version: 4
120
119
  summary: Ruby toolkit for working with the Vindi API