Class: ActiveRecord::Type::HashLookupTypeMap

Inherits:
TypeMap
  • Object
show all
Defined in:
lib/active_record/type/hash_lookup_type_map.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from TypeMap

#clear, #fetch, #initialize, #lookup, #register_type

Constructor Details

This class inherits a constructor from ActiveRecord::Type::TypeMap

Instance Method Details

#alias_type(type, alias_type) ⇒ Object



6
7
8
# File 'lib/active_record/type/hash_lookup_type_map.rb', line 6

def alias_type(type, alias_type)
  register_type(type) { |_, *args| lookup(alias_type, *args) }
end

#key?(key) ⇒ Boolean

Returns:



10
11
12
# File 'lib/active_record/type/hash_lookup_type_map.rb', line 10

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

#keysObject



14
15
16
# File 'lib/active_record/type/hash_lookup_type_map.rb', line 14

def keys
  @mapping.keys
end