formatos-febraban 0.3.55 → 0.3.56

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9abe3b7bb6f5faf8358e74b07c545023c1eeccb0
4
- data.tar.gz: 15939b27376fb94aed1209fe7e652195b469d3bb
3
+ metadata.gz: 5cc4df1d59a75db03a43795f5ba61aee77aa06fd
4
+ data.tar.gz: 3125a9c772522f874bd41db920c95bf53cc1d1ac
5
5
  SHA512:
6
- metadata.gz: 2db97fcd6d89c36a3034154f2e0f447994f9d21d75ece45a80acb584bcd37ed98d650f03aa71c7b7f2ef41c7a9b8956b793b50521644c908b026b1fc9ae61708
7
- data.tar.gz: 53082bfce677c21974326b982b2c6688eec2e51bfd0336e6da85dc34cd9224a0a6157b6e5234646b9868c00a62abf685cf372084896639a3ed945e201c0ba870
6
+ metadata.gz: 5d33567e1cd9d1fb70fbb0ae4fb69d170d925d78a53ffa643fd783622b1bff1e784da23b0c4938c1756436fdd1ea94d22ecce35239ad49f074febfc093ea21f4
7
+ data.tar.gz: 1fc42a5f9d7c0df8ef8631e10076e642e4112a4dca47e8f52b661e6cfe71bf9da755e8b1ff445cdb988008d548bc650d8f2363feb4c3624aa1d94ef8f2df022a
@@ -5,12 +5,12 @@ class Position
5
5
  def initialize(position, length, numbers_only,
6
6
  content = '', immutable = false, obligatory = false)
7
7
 
8
- @position = position
9
- @length = length
8
+ @position = position
9
+ @length = length
10
10
  @numbers_only = numbers_only
11
- @content = adjust_content(content)
12
- @immutable = immutable
13
- @obligatory = obligatory
11
+ @content = adjust_content(content)
12
+ @immutable = immutable
13
+ @obligatory = obligatory
14
14
  end
15
15
 
16
16
  def content
@@ -52,11 +52,12 @@ class Position
52
52
  def set_content(content)
53
53
  if not @immutable
54
54
  if self.is_numbers_only? and !self.is_number(content)
55
- raise "#{@position} aceita apenas valores numéricos
55
+ raise "Posição #{@position} aceita apenas valores numéricos
56
56
  Valor: #{content}"
57
57
  end
58
58
 
59
59
  @content = self.adjust_content(content)
60
+
60
61
  else
61
62
  raise 'Valor imutável'
62
63
  end
@@ -229,4 +229,4 @@ class Cielo
229
229
  self.add_section section
230
230
  end
231
231
 
232
- end
232
+ end
@@ -5,67 +5,66 @@ class CieloDetalhe < FormatSection
5
5
  super(master, true, true, false)
6
6
 
7
7
  @section = Section.new({
8
- 0 => Position.new(1, 2, false, "01", true), # Tipo do Registro
9
- 1 => Position.new(2, 7, true), # Numero Sequencial
10
- 2 => Position.new(3, 19, true), # Numero do Cartao
11
- 3 => Position.new(4, 6, false, "000000"), # Código de Autorização
12
- 4 => Position.new(5, 8, false), # Data da Venda
13
- 5 => Position.new(6, 1, true), # Opção da Venda
14
- 6 => Position.new(7, 15, true), # Valor da venda
15
- 7 => Position.new(8, 3, true), # Quantidade de Parcelas
16
- 8 => Position.new(9, 15, true), # Preencher com zeros
17
- 9 => Position.new(10, 15, true), # Preencher com zeros
18
- 10 => Position.new(11, 15, true), # Preencher com zeros
19
- 11 => Position.new(12, 15, true), # Valor da Parcela
20
- 12 => Position.new(13, 7, true), # Numero do resumo da operação
21
- 13 => Position.new(14, 3, true), # Preencher com zeros
22
- 14 => Position.new(15, 10, true), # Numero do estabelecimento
23
- 15 => Position.new(16, 30, false), # Reservado
24
- 16 => Position.new(17, 2, true), # Status da venda
25
- 17 => Position.new(18, 8, true), # Data prevista da liquidação
26
- 18 => Position.new(19, 4, false), # Validade do cartao
27
- 19 => Position.new(20, 7, true), # Preencher com zeros
28
- 20 => Position.new(21, 15, true), # Preencher com zeros
29
- 21 => Position.new(22, 3, false), # Reservado(Brancos)
30
- 22 => Position.new(23, 4, false), # Código do erro(Brancos na remessa)
31
- 23 => Position.new(24, 11, false), # Referencia (Brancos)
32
- 24 => Position.new(25, 19, false), # Cartao Novo(Brancos)
33
- 25 => Position.new(26, 4, false), # Vencimento Novo (Brancos)
34
- 26 => Position.new(27, 2, false), # Reservado(Brancos)
35
-
36
- })
8
+ 0 => Position.new(1, 2, false, "01", true), # Tipo do Registro
9
+ 1 => Position.new(2, 7, true), # Numero Sequencial
10
+ 2 => Position.new(3, 19, true), # Numero do Cartão
11
+ 3 => Position.new(4, 6, false, "000000"), # Código de Autorização
12
+ 4 => Position.new(5, 8, false), # Data da Venda
13
+ 5 => Position.new(6, 1, true), # Opção da Venda
14
+ 6 => Position.new(7, 15, true), # Valor da venda
15
+ 7 => Position.new(8, 3, true), # Quantidade de Parcelas
16
+ 8 => Position.new(9, 15, true), # Preencher com zeros
17
+ 9 => Position.new(10, 15, true), # Preencher com zeros
18
+ 10 => Position.new(11, 15, true), # Preencher com zeros
19
+ 11 => Position.new(12, 15, true), # Valor da Parcela
20
+ 12 => Position.new(13, 7, true), # Numero do resumo da operação
21
+ 13 => Position.new(14, 3, true), # Preencher com zeros
22
+ 14 => Position.new(15, 10, true), # Numero do estabelecimento
23
+ 15 => Position.new(16, 30, false), # Reservado
24
+ 16 => Position.new(17, 2, true), # Status da venda
25
+ 17 => Position.new(18, 8, true), # Data prevista da liquidação
26
+ 18 => Position.new(19, 4, false), # Validade do cartao
27
+ 19 => Position.new(20, 7, true), # Preencher com zeros
28
+ 20 => Position.new(21, 15, true), # Preencher com zeros
29
+ 21 => Position.new(22, 3, false), # Reservado(Brancos)
30
+ 22 => Position.new(23, 4, false), # Código do erro(Brancos na remessa)
31
+ 23 => Position.new(24, 11, false), # Referencia (Brancos)
32
+ 24 => Position.new(25, 19, false), # Cartao Novo(Brancos)
33
+ 25 => Position.new(26, 4, false), # Vencimento Novo (Brancos)
34
+ 26 => Position.new(27, 2, false), # Reservado(Brancos)
35
+ })
37
36
  end
38
37
 
39
38
  #-------------------------------------------------------------------
40
39
  #-------------------------------------------------------------------
41
40
  # Gerais
42
41
  def process_section file
43
- self.set_sequencial file[2..8]
44
- self.set_numero_cartao file[9..27]
45
- self.set_codigo_autorizacao file[28..33]
46
- self.set_data_venda file[34..41]
47
- self.set_opcao_venda file[42..42]
48
- self.set_valor_venda file[43..57]
49
- self.numero_parcelas file[58..60]
50
- self.set_reservado_1 file[61..75]
51
- self.set_reservado_2 file[76..90]
52
- self.set_reservado_3 file[91..105]
53
- self.set_valor_parcela file[106..120]
54
- self.set_numero_lote file[121..127]
55
- self.set_reservado_4 file[128..130]
56
- self.set_numero_cielo file[131..140]
57
- self.set_reservado_5 file[141..170]
58
- self.set_status_venda file[171..172]
59
- self.set_data_liquidacao file[173..180]
60
- self.set_validade_cartao file[181..184]
61
- self.set_reservado_6 file[185..191]
62
- self.set_reservado_7 file[192..206]
63
- self.set_reservado_8 file[207..209]
64
- self.set_codigo_erro file[210..213]
65
- self.set_reservado_9 file[214..224]
66
- self.set_cartao_novo file[225..243]
67
- self.set_vencimento_novo file[244..247]
68
- self.set_reservado_10 file[248..249]
42
+ self.set_sequencial file[2..8]
43
+ self.set_numero_cartao file[9..27]
44
+ self.set_codigo_autorizacao file[28..33]
45
+ self.set_data_venda file[34..41]
46
+ self.set_opcao_venda file[42..42]
47
+ self.set_valor_venda file[43..57]
48
+ self.numero_parcelas file[58..60]
49
+ self.set_reservado_1 file[61..75]
50
+ self.set_reservado_2 file[76..90]
51
+ self.set_reservado_3 file[91..105]
52
+ self.set_valor_parcela file[106..120]
53
+ self.set_numero_lote file[121..127]
54
+ self.set_reservado_4 file[128..130]
55
+ self.set_numero_cielo file[131..140]
56
+ self.set_reservado_5 file[141..170]
57
+ self.set_status_venda file[171..172]
58
+ self.set_data_liquidacao file[173..180]
59
+ self.set_validade_cartao file[181..184]
60
+ self.set_reservado_6 file[185..191]
61
+ self.set_reservado_7 file[192..206]
62
+ self.set_reservado_8 file[207..209]
63
+ self.set_codigo_erro file[210..213]
64
+ self.set_reservado_9 file[214..224]
65
+ self.set_cartao_novo file[225..243]
66
+ self.set_vencimento_novo file[244..247]
67
+ self.set_reservado_10 file[248..249]
69
68
  end
70
69
 
71
70
  def get_sequencial
@@ -116,7 +115,6 @@ class CieloDetalhe < FormatSection
116
115
  self.get_section_value(22)
117
116
  end
118
117
 
119
-
120
118
  def set_sequencial valor
121
119
  self.set_section_value(1, valor)
122
120
  end
@@ -245,13 +243,12 @@ class CieloDetalhe < FormatSection
245
243
  #-------------------------------------------------------------------
246
244
  # Validações
247
245
  def is_valid?
248
- (self.get_sequencial.length > 0 and
249
- self.get_data_venda.length > 0 and
250
- self.get_numero_lote.length > 0 and
251
- self.get_numero_cielo.length > 0 and
252
- self.get_numero_cartao.length > 0 and
246
+ (self.get_sequencial.length > 0 and
247
+ self.get_data_venda.length > 0 and
248
+ self.get_numero_lote.length > 0 and
249
+ self.get_numero_cielo.length > 0 and
250
+ self.get_numero_cartao.length > 0 and
253
251
  self.get_validade_cartao.length > 0 and
254
252
  self.get_valor > 0)
255
253
  end
256
-
257
- end
254
+ end
@@ -1,5 +1,5 @@
1
1
  module Formatos
2
2
  module Febraban
3
- VERSION = '0.3.55'
3
+ VERSION = '0.3.56'
4
4
  end
5
5
  end
@@ -55,24 +55,6 @@ class Febraban150A < FormatSection
55
55
  })
56
56
  end
57
57
 
58
- def process_section(file)
59
- self.set_id_registro (file[1..1])
60
- self.set_codigo_remessa (file[2..2])
61
- self.set_literal (file[3..9])
62
- self.set_codigo_servico (file[10..11])
63
- self.set_servico (file[12..26])
64
- self.set_codigo_empresa (file[27..46])
65
- self.set_nome_empresa (file[47..76])
66
- self.set_codigo_banco (file[77..79])
67
- self.set_nome_banco (file[80..94])
68
- self.set_data_geracao (file[95..100])
69
- self.set_branco_1 (file[101..108])
70
- self.set_id_sistema (file[109..110])
71
- self.set_seq_arquivo (file[111..117])
72
- self.set_branco_2 (file[118..394])
73
- self.set_seq_registro (file[395..400])
74
- end
75
-
76
58
  #-------------------------------------------------------------------
77
59
  #-------------------------------------------------------------------
78
60
  # Gerais
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatos-febraban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.55
4
+ version: 0.3.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Ricardo Almeida
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler