holidays/README
Alex Dunae 9b9b0b2046 Improved test suite
Added support for :any and sub regions
Added data/common_methods.yaml
Updated docs
2007-11-22 20:39:26 +00:00

54 lines
1.3 KiB
Plaintext

= Ruby Holidays Gem
A set of classes to deal with holidays in Ruby.
Extends Ruby's built-in Date class and supports custom holiday definition lists.
=== Examples
==== Using the Holidays class
# Get all holidays on April 25, 2008 in Australia
date = Date.civil(2008,4,25)
Holidays.by_day(date, :au)
=> [{:name => 'ANZAC Day',...}]
# Get all holidays in July, 2008 in Canada and the US
from = Date.civil(2008,7,1)
to = Date.civil(2008,7,31)
Holidays.between(from, to, [:ca,:us])
=> [{:name => 'Canada Day',...}
{:name => 'Idenpendence Day',...}]
==== Extending Ruby's Date class
# Lookup Canada Day in the :ca region
Date.civil(2008,7,1).is_holiday?(:ca)
=> true
# Lookup Canada Day in the :fr region
Date.civil(2008,7,1).is_holiday?(:fr)
=> false
=== Installation
To install the gem from RubyForge:
gem install holidays
Or, download the source <tt>.tgz</tt> file from http://rubyforge.org/holidays/ and
extract it somewhere in your include path.
=== Custom holiday definitions
=== Credits and code
* Project page: http://code.dunae.ca/holidays
* Source: http://code.dunae.ca/svn/holidays
* Docs: http://code.dunae.ca/holidays/doc
By Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007.
Made on Vancouver Island.