We needed to translate integers from 0 to 100 into words for our system, and looked at a few gems, and thought about the logic, and then said "f*ck it" and just created a YAML file:
0: zero
1: one
2: two
...
Problem solved, and testing was pretty straightforward too!
I love it. Sometimes, if you have a limit like that, writing it out manually can be easier on a quick deadline! Especially if you need to support many languages.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes. But this is just an exercise for fun?
And a damn good exercise it is too.
We needed to translate integers from 0 to 100 into words for our system, and looked at a few gems, and thought about the logic, and then said "f*ck it" and just created a YAML file:
Problem solved, and testing was pretty straightforward too!
I love it. Sometimes, if you have a limit like that, writing it out manually can be easier on a quick deadline! Especially if you need to support many languages.