Sha256: f9f306a8923c8ff9e2c87b96f40f33f349f70a6399fb0cbd5190a9df8b0030fd
Contents?: true
Size: 469 Bytes
Versions: 4
Compression:
Stored size: 469 Bytes
Contents
module ActiveRecord module Type class HashLookupTypeMap < TypeMap # :nodoc: delegate :key?, to: :@mapping def lookup(type, *args) @mapping.fetch(type, proc { default_value }).call(type, *args) end def fetch(type, *args, &block) @mapping.fetch(type, block).call(type, *args) end def alias_type(type, alias_type) register_type(type) { |_, *args| lookup(alias_type, *args) } end end end end
Version data entries
4 entries across 4 versions & 1 rubygems