You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be good to allow types to be registered under custom keys, this way we can register under symbol keys and reduce allocations. Would also be good to allow for aliases (i.e. :int => :integer, :bool => :boolean). This should also allow us to get rid of the const_missing definition and I think the interface will be nicer.
Also, perhaps we should move the registration out of Dry::Data::Struct and make it explicit (i.e. Dry::Data.register(:name, Type, aliases: [:alias1, :alias2]).
This should make the library much more flexible, the obvious detriment is that there will be a bit of setup involved. I think it would also be good to make it so that a user can get a container without any of the built in types, and just create Dry::Data container and register the built-in types.
The text was updated successfully, but these errors were encountered:
I think it would be good to allow types to be registered under custom keys, this way we can register under symbol keys and reduce allocations. Would also be good to allow for aliases (i.e.
:int
=>:integer
,:bool
=>:boolean
). This should also allow us to get rid of theconst_missing
definition and I think the interface will be nicer.Also, perhaps we should move the registration out of
Dry::Data::Struct
and make it explicit (i.e.Dry::Data.register(:name, Type, aliases: [:alias1, :alias2]
).This should make the library much more flexible, the obvious detriment is that there will be a bit of setup involved. I think it would also be good to make it so that a user can get a container without any of the built in types, and just create
Dry::Data
container and register the built-in types.The text was updated successfully, but these errors were encountered: