Commit 87387b4a authored by Alasdair Keyes's avatar Alasdair Keyes

Add perldoc for value objects in Finance namespace

parent 101b3355
......@@ -178,3 +178,43 @@ sub validate {
}
1;
=head1 NAME
ValueObject::Finance::Currency::Code - Value Object for Currency Codes
=head1 SYNOPSIS
use ValueObject::Finance::Currency::Code;
my $vo = ValueObject::Finance::Currency::Code->new('gbp');
=head1 DESCRIPTION
Provides Value Object for validation of ISO 4217 currency codes. Case insensitive.
=head1 METHODS
=over 4
=item new($value = '')
Creates a new object
Throws ValueObject::Finance::Currency::Exception::InvalidCode if $value is invalid
=item validate()
Called during instantiation to validate $value
=item value()
Returns the raw value as passed in at instantiation
=back
=head1 SEE ALSO
L<ValueObject::Base>
=cut
......@@ -27,3 +27,55 @@ sub new {
}
1;
=head1 NAME
ValueObject::Finance::Money - Value object to represent money amounts
=head1 SYNOPSIS
use base ValueObject::Finance::Money;
my $vo = ValueObject::Finance::Money->new(35.65);
=head1 DESCRIPTION
ValueObject::Finance::Money provides Value Object for validation of money
amounts
Returns one of
ValueObject::Finance::Money::Comma
ValueObject::Finance::Money::Period
or Exception object ValueObject::Finance::Money::Exception::Invalid
=head1 METHODS
=over 4
=item new($value = '')
Creates a new object
Throws ValueObject::Finance::Money::Exception::Invalid if $value is invalid
=item validate()
Called during instantiation to validate $value
=item value()
Returns the raw value as passed in at instantiation
=item boolean()
Returns a boolean 0 or 1 for no/yes
=back
=head1 SEE ALSO
L<ValueObject::Finance::Money::Comma>,
L<ValueObject::Finance::Money::Period>
=cut
......@@ -26,3 +26,43 @@ sub full_value {
}
1;
=head1 NAME
ValueObject::Finance::Money::Comma - Value Object for comma separated money amounts
=head1 SYNOPSIS
use ValueObject::Finance::Money::Comma
my $vo = ValueObject::Finance::Money::Comma->new(45,23);
=head1 DESCRIPTION
Provides Value Object for validation of monetary amounts using commas.
=head1 METHODS
=over 4
=item new($value = '')
Creates a new object
Throws ValueObject::Finance::Money::Exception::InvalidComma if $value is invalid
=item validate()
Called during instantiation to validate $value
=item value()
Returns the raw value as passed in at instantiation
=back
=head1 SEE ALSO
L<ValueObject::Finance::Money::Base>
=cut
......@@ -20,3 +20,43 @@ sub full_value {
}
1;
=head1 NAME
ValueObject::Finance::Money::Period - Value Object for period separated money amounts
=head1 SYNOPSIS
use ValueObject::Finance::Money::Period
my $vo = ValueObject::Finance::Money::Period->new(45.23);
=head1 DESCRIPTION
Provides Value Object for validation of monetary amounts using periods.
=head1 METHODS
=over 4
=item new($value = '')
Creates a new object
Throws ValueObject::Finance::Money::Exception::InvalidPeriod if $value is invalid
=item validate()
Called during instantiation to validate $value
=item value()
Returns the raw value as passed in at instantiation
=back
=head1 SEE ALSO
L<ValueObject::Finance::Money::Base>
=cut
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment