Class: CNAB240::BancoABC::Entities::HeaderLoteBuilder

Inherits:
Base
  • Object
show all
Defined in:
lib/cnab240/bancoabc/entities/header_lote_builder.rb

Instance Method Summary collapse

Methods inherited from Base

#register?, #trailler?

Instance Method Details

#codigo_do_banco(data = "246") ⇒ Object



11
12
13
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 11

def codigo_do_banco(data = "246")
  prepend_zero(data, 3)
end

#codigo_identificacao_empresa_banco(data) ⇒ Object



51
52
53
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 51

def codigo_identificacao_empresa_banco(data)
  prepend_zero(data, 20)
end

#data_credito(data = nil) ⇒ Object



73
74
75
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 73

def data_credito(data = nil)
  prepend_zero(data, 8)
end

#data_gravacao(date_time) ⇒ Object



69
70
71
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 69

def data_gravacao(date_time)
  date_time.strftime("%d%m%Y")
end

#header?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 7

def header?
  true
end

#lote_servico(data) ⇒ Object



15
16
17
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 15

def lote_servico(data)
  prepend_zero(data, 4)
end

#mensagem(data = nil) ⇒ Object



59
60
61
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 59

def mensagem(data = nil)
  append_space(data, 40)
end

#nome_empresa(data) ⇒ Object



55
56
57
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 55

def nome_empresa(data)
  prepend_zero(data, 30)
end

#numero_inscricao_empresa(data) ⇒ Object



47
48
49
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 47

def numero_inscricao_empresa(data)
  prepend_zero(data, 15)
end

#numero_remessa(date_time) ⇒ Object



63
64
65
66
67
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 63

def numero_remessa(date_time)
  date = date_time.day.to_s.to_s + date_time.month.to_s.to_s + date_time.hour.to_s.to_s + date_time.min.to_s.to_s

  prepend_zero(date, 8)
end

#numero_versao_layout(data) ⇒ Object



35
36
37
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 35

def numero_versao_layout(data)
  prepend_zero(data, 3)
end

#tipo_inscricao_empresa(data) ⇒ Object



43
44
45
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 43

def tipo_inscricao_empresa(data)
  append_space(data, 1)
end

#tipo_operacao(data) ⇒ Object



23
24
25
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 23

def tipo_operacao(data)
  prepend_zero(data, 1)
end

#tipo_registro(data = "1") ⇒ Object



19
20
21
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 19

def tipo_registro(data = "1")
  prepend_zero(data, 1)
end

#tipo_servico(data) ⇒ Object



27
28
29
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 27

def tipo_servico(data)
  prepend_zero(data, 2)
end

#uso_exclusivo(data = nil) ⇒ Object



77
78
79
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 77

def uso_exclusivo(data = nil)
  append_space(data, 33)
end

#uso_exclusivo_cnab_1(data = nil) ⇒ Object



31
32
33
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 31

def uso_exclusivo_cnab_1(data = nil)
  append_space(data, 2)
end

#uso_exclusivo_cnab_2(data = nil) ⇒ Object



39
40
41
# File 'lib/cnab240/bancoabc/entities/header_lote_builder.rb', line 39

def uso_exclusivo_cnab_2(data = nil)
  append_space(data, 1)
end