Sha256: f124b64b6e6669116a847f298817cdbf12d5bb70ed1673c575aa8d3fdabca7ea

Contents?: true

Size: 939 Bytes

Versions: 4

Compression:

Stored size: 939 Bytes

Contents

module Kinabo
  module Bradesco
    module Remessa
      class Header < Hashie::Dash
        include Kinabo::Utils

        property :codigo_empresa, required: true, default: Kinabo.config.bradesco&.dig(:convenio)
        property :nome_empresa, required: true, default: Kinabo.config.bradesco&.dig(:nome_empresa)
        property :data_gravacao, required: true
        property :sequencial, required: true

        def build
          parts = '01REMESSA01'

          parts << justify_string('COBRANCA', 15)
          parts << justify_number(codigo_empresa, 20)
          parts << justify_string(nome_empresa, 30)
          parts << '237'
          parts << justify_string('BRADESCO', 15)
          parts << justify_number(data_gravacao, 6)
          parts << justify_string('', 8)
          parts << 'MX'
          parts << justify_number(sequencial, 7)
          parts << justify_string('', 277)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kinabo-0.5.0 lib/kinabo/bradesco/remessa/header.rb
kinabo-0.4.0 lib/kinabo/bradesco/remessa/header.rb
kinabo-0.3.0 lib/kinabo/bradesco/remessa/header.rb
kinabo-0.2.0 lib/kinabo/bradesco/remessa/header.rb