The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Ruby Month 0.1.0

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Francis Hwang

Posts: 130
Nickname: francis
Registered: Jul, 2004

Francis Hwang is the Director of Technology at Rhizome.org.
Ruby Month 0.1.0 Posted: Aug 28, 2005 11:05 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Francis Hwang.
Original Post: Ruby Month 0.1.0
Feed Title: Francis Hwang's site: ruby
Feed URL: http://fhwang.net/syndicate/ruby.atom
Feed Description: Author & artist Francis Hwang's personal site.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Francis Hwang
Latest Posts From Francis Hwang's site: ruby

Advertisement

From out of murky depths of the Lafcadio codebase, I bring you a tiny utility library called Ruby Month. It’s a modest thing, intended to make month-level manipulations easier. For example:

require 'month'
jun2005 = Month.new( 2005, 6 )
jun2005.to_s # => "Jun 2005" 
jun2005.start_date.to_s # => "2005-06-01" 
jun2005.end_date.to_s # => "2005-06-30" 
jul2005 = jun2005.next
jul2005.to_s # => "Jul 2005" 
may2005 = jun2005.prev
may2005.to_s # => "May 2005" 
to_sort = [ jul2005, may2005, jun2005 ]
to_sort.join ', ' # => "Jul 2005, May 2005, Jun 2005" 
to_sort.sort!
to_sort.join ', ' # => "May 2005, Jun 2005, Jul 2005" 

Read: Ruby Month 0.1.0

Topic: No, XPath on Messy HTML is Just as Easy in Ruby Previous Topic   Next Topic Topic: Hoodlums IV: No Sleep Till Borken

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use