Class: Abank::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/abank.rb

Overview

CLI para carregar folhas calculo comuns no bigquery

Instance Method Summary collapse

Instance Method Details

#apagactObject

apaga contrato arrendamento



35
36
37
# File 'lib/abank.rb', line 35

def apagact
  Big.new(options.transform_keys(&:to_sym)).ct_apaga
end

#apagamvObject

apaga movimentos



27
28
29
# File 'lib/abank.rb', line 27

def apagamv
  Big.new(options.transform_keys(&:to_sym)).mv_delete.ct_dados.re_insert
end

#criactObject

cria contrato arrendamento



44
45
46
# File 'lib/abank.rb', line 44

def criact
  Big.new(options.transform_keys(&:to_sym)).ct_cria
end

#recriactObject

atualiza rendas de contrato arrendamento



53
54
55
56
57
# File 'lib/abank.rb', line 53

def recriact
  opc = options[:c]
  Big.new(c: opc, t: options[:t]).ct_apaga
  Big.new(c: opc, t: true, d: options[:d]).ct_cria
end

#recriareObject

atualiza rendas dos contratos ativos



62
63
64
# File 'lib/abank.rb', line 62

def recriare
  Big.new(options.transform_keys(&:to_sym)).re_atualiza
end

#showObject

mostra folha calculo



80
81
82
83
84
# File 'lib/abank.rb', line 80

def show
  Dir.glob("#{DR}/*.xlsx").sort.each do |file|
    Folha.new(options.merge(f: file)).processa_xls
  end
end

#tagObject

classifica movimentos



20
21
22
# File 'lib/abank.rb', line 20

def tag
  Big.new(options.to_h).mv_classifica.ct_dados.re_insert
end

#workObject

carrega/apaga dados da folha calculo



72
73
74
75
76
# File 'lib/abank.rb', line 72

def work
  Dir.glob("#{DR}/*.xlsx").sort.each do |file|
    Folha.new(options.transform_keys(&:to_sym).merge(f: file, i: true)).processa_xls
  end
end