Sha256: 43dad56198c97b6ee1a7242c6648254b7433dd4f7c81fefd100228aa1a690860

Contents?: true

Size: 420 Bytes

Versions: 4

Compression:

Stored size: 420 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)
        end

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

          return if value.nil?

          hash.fetch(value)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.4.4 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.4.2 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.4.1 lib/ledger_sync/serialization/type/mapping_type.rb
ledger_sync-1.4.0 lib/ledger_sync/serialization/type/mapping_type.rb