-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model.Coerce #19
base: master
Are you sure you want to change the base?
Model.Coerce #19
Conversation
Cool, I'd like to include this in the main repo but probably not as core functionality. Rather, like this potential addition, I'd prefer it to be included manually with some sort of Plugin Architecture™ (probably very simple). What do you think? |
Sure, that sounds like a good idea. Are you currently working on something like that? If not I could probably give it a shot if you helped me define the API. |
I'm currently preparing the groundwork for it, it'll probably be something like this:
update: fix code example |
Looks like @github's new reply-via-email thing needs a little more work... |
I've just pushed a few changes which include a simple "plugin architecture" which is used like so:
|
Cool. I'll update my pull request to use the new "plugin architecture". |
Moved Model.Coerce to Plugin.Coerce to make use of the new "plugin architecture". Not sure how you want to bundle the plugins so I just left it for now. |
Hi, I had a stab at adding the Model.Coerce that came up in the date serialization discussion. I've added integer, boolean, float and isoDate coercion as a start since that is what I needed, but one can easily add more by adding to Model.Coerce.
The api looks like this:
If this is something you would like to use I'll add docs and stuff.