I had the need to implement some unit conversions and so used it as an
opportunity to learn a bit more Ruby than I know through my exposure via
Rails.
I've ended up with a very simple module which has probably already been
implemented a bunch of times by different people, but it was a good
learning exercise.
I've very much appreciate any feedback on the code, is it any good
etc... so that I can improve it and any further code.
Very quick (and inconsistent to show the diff instantiation options)
examples:
I already posted this comment on your website, but I send it to the
list just in case somebody wants to comment.
It would be nice to have alias for the US spelling of litre, i.e: liter.
Also, the British spelling of meter (metre) could be added to make it
more complete.
Cheers,
Ed
···
On 9/12/05, Richard Livsey <richard@livsey.org> wrote:
I had the need to implement some unit conversions and so used it as an
opportunity to learn a bit more Ruby than I know through my exposure via
Rails.
Very quick (and inconsistent to show the diff instantiation options)
examples:
Thou shalt study thy libraries and strive not to reinvent them without cause,
that thy code may be short and readable and thy days pleasant and productive.
-- Seventh commandment for C programmers
It would be nice to have alias for the US spelling of litre, i.e: liter.
Also, the British spelling of meter (metre) could be added to make it
more complete.
Thanks.
I'll add these in this evening. I must admit I was a bit inconsistant at my naming of the aliases - IE I used the American meter but the British litre! That's 4am coding for you.
Still confused about what to do for the default 'gallon' as, unlike ton and tonne, there is no difference in the spelling of metric and imperial versions.
···
On 9/12/05, Richard Livsey <richard@livsey.org> wrote: