Sha256: b408db6ebe7d4f6b352f7ced9bb908b38db08bbfc7dc93d6a6e8ea1b992e509c

Contents?: true

Size: 475 Bytes

Versions: 6

Compression:

Stored size: 475 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module Adaptors
    module QuickBooksOnline
      module LedgerSerializerType
        class AmountType < Adaptors::LedgerSerializerType::ValueType
          def convert_from_ledger(value:)
            return if value.nil?

            (value * 100).to_i
          end

          def convert_from_local(value:)
            return if value.nil?

            value / 100.0
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ledger_sync-1.3.5 lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb
ledger_sync-1.3.4 lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb
ledger_sync-1.3.3 lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb
ledger_sync-1.3.2 lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb
ledger_sync-1.3.1 lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb
ledger_sync-1.1.3 lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb