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
Proper/suggested way of demarshalling data? #227
Comments
I think this is definitely a scenario hashie should solve if it doesn't already. If I am not mistaken this is something custom to your app. You would have to know that You should be able to do this with |
I haven't yet. I'll look into the coerce extension- thanks! Mark Silverberg http://SocialHealthInsights.comhttp://SocialHealthInsights.com On Sep 10, 2014, at 12:32 PM, "Daniel Doubrovkine (dB.) @dblockdotorg" <notifications@github.commailto:notifications@github.com> wrote: I think this is definitely a scenario hashie should solve if it doesn't already. If I am not mistaken this is something custom to your app. You would have to know that created_at is actually a DateTime. You should be able to do this with Hashie::Extensions::Coercion, ie. coerce_key and friends. Did you try this? Reply to this email directly or view it on GitHubhttps://github.com//issues/227#issuecomment-55151513. |
+1! ✊ |
Building on what dB said earlier, I think this should be able to be easily done using coercion procs. If it's not, show us an example and we can look into creating something that will help you out! |
First off, thanks for creating and continuing to maintain Hashie. I'm dealing with a use case where all data from the API is returned as strings (in the case of numbers) and there are some fields such as timestamps that I want to convert into Ruby Time objects. Is there a way to do this in Hashie currently with a Dash (it seems like a good extension to me) or is there a suggested way to do this in conjunction with Hashie?
Thanks!
The text was updated successfully, but these errors were encountered: