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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +6 -4
- data/lib/boletoman.rb +1 -0
- data/lib/boletoman/boleto.rb +25 -0
- data/lib/boletoman/builders/base.rb +1 -1
- data/lib/boletoman/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6d13a94c2c0e1afad13f7400cf2599bedc56919
|
4
|
+
data.tar.gz: 4266871d1c25b05b05830ab3dee4f3cb4b4b5c80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26eae44f1c2d273adf6eabc4ca952bbeed6a1823c7c48f804c5ce555c5e279789a071f7c0bea03bb368875a82fffeed97b6019a2f9d743c3d68907274780a8f5
|
7
|
+
data.tar.gz: af0d15850bfd2da0bb8e4e1e4265eb34dc5c5060a8a8fd06f1a661b56b7d9cd44c30e3a82ed004ed5f7025f00a11a7aee181526f8ec424bc5be9341761986af9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -82,9 +82,11 @@ builder = Boletoman::Builders::Itau.new({
|
|
82
82
|
}
|
83
83
|
})
|
84
84
|
|
85
|
-
|
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
|
-
|
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
@@ -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
|
data/lib/boletoman/version.rb
CHANGED
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.
|
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-
|
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
|