Sha256: 254a1b45e20086ad1e4f7ec9d4a9f82d4be6594f7946bdb8a818c36ea950a199

Contents?: true

Size: 439 Bytes

Versions: 19

Compression:

Stored size: 439 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module Serialization
    module Type
      class MappingType < LedgerSync::Type::Value
        attr_reader :hash

        def initialize(args = {})
          @hash = args.fetch(:hash)

          super()
        end

        def cast_value(args = {})
          value = args.fetch(:value)

          return if value.nil?

          hash.fetch(value)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ledger_sync-3.0.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.6.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.5.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.4.4 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.3.1 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.2.3 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.2.1 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.2.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.0.2 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.0.1 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.0.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-2.0.0.pre.1 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.8.1 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.8.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.7.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.6.0 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.5.2 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.5.1 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.5.0 lib/ledger_sync/serialization/type/mapping_type.rb