Would calling 3.am or 1130.pm be a useful way of getting a T

Would “am” and “pm” be convenient and useful methods that Rails should
stick on top of the Numeric class?

So instead of calling Time.parse(“23:30”) to get a Time object at
11:30 PM, you could do 1130.pm instead.

Just trying to get an opinion before I create a patch, unit tests, etc
and try and convince someone to notice :slight_smile:

Here are the methods if anyone wants to use them:

http://code.inklingmarkets.com/journal/2007/2/7/an-easy-way-to-have-a-time-in-ruby.html

That’s actually pretty cool! I’ve never even thought of that. I’d
probably use it a few times, especially when doing scheduling of
things. It would make it easier to think about at least. :slight_smile:

–Jeremy

On 2/7/07, inkling [email protected] wrote:

Here are the methods if anyone wants to use them:

http://code.inklingmarkets.com/journal/2007/2/7/an-easy-way-to-have-a-time-in-ruby.html


http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/

On 2/7/07, inkling [email protected] wrote:

I think it’s a very useful idea. It follows the same concepts already
in
place with dates.

Consider it noticed. :slight_smile:


Andrew S.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs