Avi Finkel > Money-ChangeMaker-0.3.1 > Money::ChangeMaker::Denomination

Download:
Money-ChangeMaker-0.3.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.3   Source  

NAME ^

Money::ChangeMaker::Denomination - OO representation of a monetary unit

SYNOPSIS ^

        See L<Money::ChangeMaker>

DESCRIPTION ^

An object of type Denomination represents a monetary unit, such as a dollar bill or a 5 rupee coin. Objects such as this are used by the Money::ChangeMaker. Instead of subclassing this package, it will generally use singelton exemplar objects to hold basic type information.

METHODS ^

new(value, name, [plural])

This is the constructor method for the class.

The first argument must be numeric, and represents the value of this object. If this Denomination is part of a set, it is important that its value be expressed in the same base units as the other Denominations in that set. For example, if the nickel Denomination has the value 5, then the 10 dollar bill Denomination should have the value 1000, not 10. Please see the documentation for the Money::ChangeMaker::Presets module for notes on the downsides of using non-integer values in denominations.

The second argument is the name of this Denomination, such as "dollar bill" or "penny". The third argument is optional, and if provided, sets the 'plural name' of the Denomination. If this argument is not provided, then the Denomination's name is appended with "s" to create the plural. This argument would be provided in the case of, for example, "pennies".

value([value])

Sets/gets the value of this object

name([name])

Sets/gets the name of this object.

plural([plural])

Sets/gets the plural name of this object.

Future Work ^

AUTHOR ^

Copyright 2006 Avi Finkel <avi@finkel.org>

This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)

syntax highlighting: