boletoman 0.0.3 → 0.0.4

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: 4c4d807fb70182bb6cb5360928a83330f75cc65e
4
- data.tar.gz: 06d89aa8f0e35a238d5ade257068ace2bbc2f122
3
+ metadata.gz: a6d13a94c2c0e1afad13f7400cf2599bedc56919
4
+ data.tar.gz: 4266871d1c25b05b05830ab3dee4f3cb4b4b5c80
5
5
  SHA512:
6
- metadata.gz: 932ad28f2e3002b3be0e616969779daf924368a3a8a7ec095f20afd11468c6310718adb5b5060ea090956f496138424e0fa13e4cf83e1f39628f3e45bbc72f40
7
- data.tar.gz: f5551431912be623c1f41de819e8b30311c7b378e3038106b6c15ab5cbf8d5417b50a3a76df5426be07c5e02297439c6cb861d04147edd27c512cb3a5dbfdb75
6
+ metadata.gz: 26eae44f1c2d273adf6eabc4ca952bbeed6a1823c7c48f804c5ce555c5e279789a071f7c0bea03bb368875a82fffeed97b6019a2f9d743c3d68907274780a8f5
7
+ data.tar.gz: af0d15850bfd2da0bb8e4e1e4265eb34dc5c5060a8a8fd06f1a661b56b7d9cd44c30e3a82ed004ed5f7025f00a11a7aee181526f8ec424bc5be9341761986af9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.0.4 (10/09/2018)
2
+
3
+ * Adiciona classe `Boleto` para representar boleto gerado
4
+
1
5
  ### 0.0.3 (03/09/2018)
2
6
 
3
7
  * Adiciona opção `verbose` que permite logar xmls do savon
data/README.md CHANGED
@@ -82,9 +82,11 @@ builder = Boletoman::Builders::Itau.new({
82
82
  }
83
83
  })
84
84
 
85
- pdf = builder.build
85
+ boleto = builder.build
86
86
 
87
- IO.binwrite('boleto-itau.pdf', pdf) # salva binário no arquivo
87
+ IO.binwrite('boleto-itau.pdf', boleto.pdf) # salva binário no arquivo
88
+
89
+ # outros métodos disponíveis: boleto.line, boleto.barcode, boleto.nosso_numero
88
90
  ```
89
91
 
90
92
  O builder irá registrar o boleto no banco e gerar um pdf.
@@ -146,9 +148,9 @@ builder = Boletoman::Builders::Santander.new({
146
148
  }
147
149
  })
148
150
 
149
- pdf = builder.build
151
+ boleto = builder.build
150
152
 
151
- IO.binwrite('boleto-santander.pdf', pdf) # salva binário no arquivo
153
+ IO.binwrite('boleto-santander.pdf', boleto.pdf) # salva binário no arquivo
152
154
  ```
153
155
 
154
156
  O builder irá registrar o boleto no banco e gerar um pdf.
data/lib/boletoman.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "boletoman/version"
2
2
  require "boletoman/config"
3
+ require "boletoman/boleto"
3
4
  require "boletoman/builders/itau"
4
5
  require "boletoman/services/santander/query/facade"
5
6
  require "boletoman/builders/santander"
@@ -0,0 +1,25 @@
1
+ module Boletoman
2
+ class Boleto
3
+ attr_reader :pdf_generator_instance
4
+
5
+ def initialize(pdf_generator_instance)
6
+ @pdf_generator_instance = pdf_generator_instance
7
+ end
8
+
9
+ def line
10
+ pdf_generator_instance.codigo_barras.linha_digitavel
11
+ end
12
+
13
+ def barcode
14
+ pdf_generator_instance.codigo_barras
15
+ end
16
+
17
+ def nosso_numero
18
+ pdf_generator_instance.nosso_numero_boleto
19
+ end
20
+
21
+ def pdf
22
+ pdf_generator_instance.to_pdf
23
+ end
24
+ end
25
+ end
@@ -11,7 +11,7 @@ module Boletoman
11
11
  end
12
12
 
13
13
  def build
14
- instance.to_pdf
14
+ ::Boletoman::Boleto.new(instance)
15
15
  end
16
16
 
17
17
  def instance
@@ -1,3 +1,3 @@
1
1
  module Boletoman
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boletoman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glauco Custódio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-03 00:00:00.000000000 Z
11
+ date: 2018-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -198,6 +198,7 @@ files:
198
198
  - boletoman.gemspec
199
199
  - lib/.DS_Store
200
200
  - lib/boletoman.rb
201
+ - lib/boletoman/boleto.rb
201
202
  - lib/boletoman/builders/base.rb
202
203
  - lib/boletoman/builders/formatter.rb
203
204
  - lib/boletoman/builders/itau.rb