Class: ROM::SQL::TypeSerializer Private
- Inherits:
-
Object
- Object
- ROM::SQL::TypeSerializer
- Extended by:
- Dry::Core::ClassAttributes
- Defined in:
- lib/rom/sql/type_serializer.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Class Method Summary collapse
- .[](db_type) ⇒ Object private
- .register(db_type, builder) ⇒ Object private
Instance Method Summary collapse
- #call(type) ⇒ Object private
Class Method Details
.[](db_type) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/rom/sql/type_serializer.rb', line 17 def self.[](db_type) registry[db_type] end |
.register(db_type, builder) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/rom/sql/type_serializer.rb', line 13 def self.register(db_type, builder) registry[db_type] = builder end |
Instance Method Details
#call(type) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rom/sql/type_serializer.rb', line 35 def call(type) return type.[:db_type] if type.[:db_type] = type.[:read] ? { read: type.[:read] } : EMPTY_HASH self.class.mapping.fetch(type.with(meta: )) { if block_given? yield(type) end or raise "Cannot serialize #{ type }" } end |