Sha256: 7ccc65e9f8f67e383f7937dba3aea31965b9441341794400e6009d91403f3912

Contents?: true

Size: 427 Bytes

Versions: 8

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module Ledgers
    module QuickBooksOnline
      module Serialization
        module Type
          class AmountFloatToIntegerType < LedgerSync::Type::Value
            def cast_value(args = {})
              value = args.fetch(:value)

              return if value.nil?

              (value * 100).to_i
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ledger_sync-1.6.0 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-1.4.4 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb