Sha256: a04f4ce9f422651282c0d756e886a39eb9d3440f892226bfea58a713f675919b

Contents?: true

Size: 1.52 KB

Versions: 2

Compression:

Stored size: 1.52 KB

Contents

= QuarterSystem

Currently the types of quarters are hardcoded but it shouldn't be tough to expand the kinds of quarter systems you wish to define for your specific project. By default the gem sets up the US fiscal calendar's definition of quarters (October-December, January-March, April-June, and July-September).

== Usage

=== Quarter.general()

Calling Quarter.general(n) where n refers to the n'th quarter of this particular year returns the Quarter object (which is a subclass of Range with a begin and end date). The boundary dates are of a subclass QuarterBoundaryDate.

If n exceeds the number of quarters in the current system, it will cycle so that in a system with 4 quarters, Quarter.general(1) is the same as Quarter.general(5) or Quarter.general(4n+1).


=== Quarter.specific()

On the other hand, Quarter.specific(n) where n exceeds the number of quarters will increment or decrement the year as required, so Quarter.specific(20) is a call for the value of the Quarter object which is the 20th quarter from the current calendar year.

=== Quarter.current()

Quarter.current simply returns the Quarter object which contains the current date, and Quarter.current_number returns the numeric value of the current quarter in the quarter system (i.e. 1 for 1st quarter of the year).

== Additional information

=== Contributors

We have a short list of valued contributors. Check them all at:

http://github.com/caleon/quarter_system/contributors

=== Maintainers

* caleon (http://github.com/caleon)

== License

MIT License. Copyright 2011 caleon.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quarter_system-0.1.2 README.rdoc
quarter_system-0.1.1 README.rdoc