Sha256: efd75e901090ff68964903a3f3c6e371a845abaabb5d2e723239b8faabc665f0

Contents?: true

Size: 378 Bytes

Versions: 13

Compression:

Stored size: 378 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ledger_sync-quickbooks_online-2.0.0 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-1.0.1 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-1.0.0 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.4.0 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.3.1 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.3.0 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.2.6 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.2.5 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.2.4 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.2.2 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.2.1 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.2.0 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb
ledger_sync-quickbooks_online-0.1.1 lib/ledger_sync/quickbooks_online/serialization/type/amount_float_to_integer_type.rb