Class: Cns::Bitcoinde

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/cns/bitcoinde.rb

Overview

classe para processar transacoes trades/ledger do bitcoinde

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dad, pop) ⇒ Bitcoinde

Returns a new instance of Bitcoinde.

Parameters:

  • dad (Hash)

    todos os dados bigquery

  • pop (Thor::CoreExt::HashWithIndifferentAccess)

    opcoes trabalho

Options Hash (pop):

  • :h (Hash) — default: {}

    configuracao dias ajuste reposicionamento temporal

  • :v (Boolean) — default: false

    mostra dados transacoes trades & ledger?

  • :t (Boolean) — default: false

    mostra transacoes todas ou somente novas?



20
21
22
23
# File 'lib/cns/bitcoinde.rb', line 20

def initialize(dad, pop)
  @bqd = dad
  @ops = pop.transform_keys(&:to_sym)
end

Instance Attribute Details

#bqdArray<Hash>, Thor::CoreExt::HashWithIndifferentAccess (readonly)

Returns:

  • (Array<Hash>)

    todos os dados bigquery

  • (Thor::CoreExt::HashWithIndifferentAccess)

    opcoes trabalho



13
14
15
# File 'lib/cns/bitcoinde.rb', line 13

def bqd
  @bqd
end

#opsArray<Hash>, Thor::CoreExt::HashWithIndifferentAccess (readonly)

Returns:

  • (Array<Hash>)

    todos os dados bigquery

  • (Thor::CoreExt::HashWithIndifferentAccess)

    opcoes trabalho



13
14
15
# File 'lib/cns/bitcoinde.rb', line 13

def ops
  @ops
end

Instance Method Details

#mresumoString

Returns texto saldos & transacoes & ajuste dias.

Returns:

  • (String)

    texto saldos & transacoes & ajuste dias



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cns/bitcoinde.rb', line 26

def mresumo
  puts("\nBITCOINDE\ntipo              bitcoinde              bigquery")
  exd[:sl].sort.each { |k, v| puts(fos(k, v)) }
  mtotais

  mtrades
  mledger
  return if novxt.empty?

  puts("\nstring ajuste dias dos trades\n-h=#{novxt.sort_by { |i| -i[:srx] }.map { |o| "#{o[:trade_id]}:0" }.join(' ')}")
end