Can someone explain this for me please?
range = (DateTime.now..DateTime.now+1.hour).step(10.minute)
=> #<Enumerator: Sat, 26 Sep 2015 16:41:18 +0100..Sat, 26 Sep 2015
17:41:18 +0100:step(600 seconds)>
2.1.3 :009 > range.to_a
=> [Sat, 26 Sep 2015 16:41:18 +0100]
Not what I expected at all.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsXVDpNezdm0V3EJKh_XRhD6hdD1Bb%3DAJ4k2a2SoEqfjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment