Sha256: a65bc9c355db19dcb48f77f0073ac38008ec99f38ae628be81f8f7119d75248f

Contents?: true

Size: 485 Bytes

Versions: 59

Compression:

Stored size: 485 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  module Type
    class HashLookupTypeMap < TypeMap # :nodoc:
      def alias_type(type, alias_type)
        register_type(type) { |_, *args| lookup(alias_type, *args) }
      end

      def key?(key)
        @mapping.key?(key)
      end

      def keys
        @mapping.keys
      end

      private
        def perform_fetch(type, *args, &block)
          @mapping.fetch(type, block).call(type, *args)
        end
    end
  end
end

Version data entries

59 entries across 59 versions & 4 rubygems

Version Path
activerecord-6.1.7.10 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.9 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.8 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.7 lib/active_record/type/hash_lookup_type_map.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.6 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.5 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.4 lib/active_record/type/hash_lookup_type_map.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.3 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.2 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7.1 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.0.6.1 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.7 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.0.6 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.6.1 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.0.5.1 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.0.5 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.6 lib/active_record/type/hash_lookup_type_map.rb
activerecord-6.1.5.1 lib/active_record/type/hash_lookup_type_map.rb