Sha256: 5816db7cad9431dbd67e6f53e126259b93db18afd0332200efe7265ff53aae83

Contents?: true

Size: 585 Bytes

Versions: 8

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module Ledgers
    module NetSuite
      class Type
        class DeserializerActiveType < LedgerSync::Type::Value
          def cast_value(args = {})
            value = args.fetch(:value)

            return if value.nil?

            case value
            when 'F'
              true
            when 'T'
              false
            else
              raise 'Unknown value'
            end
          end
        end

        def valid_classes
          [
            String
          ]
        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/netsuite/type/deserializer_active_type.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb
ledger_sync-1.4.4 lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb