| 1 | package WebService::MyGengo::Account; | ||
| 2 | |||
| 3 | 0 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 4 | use namespace::autoclean; | ||
| 5 | |||
| 6 | BEGIN { extends 'WebService::MyGengo::Base' }; | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | WebService::MyGengo::Account - An Account in the myGengo system. | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | my $client = WebService::MyGengo::Client->new( $params ); | ||
| 15 | my $acct = $client->get_account(); | ||
| 16 | |||
| 17 | printf "You have %d credits to spend\n", $acct->credits; | ||
| 18 | |||
| 19 | =head1 ATTRIBUTES | ||
| 20 | |||
| 21 | =head2 credits_spent (Num) | ||
| 22 | |||
| 23 | A decimal figure representing the number of myGengo credits this account has | ||
| 24 | spent. | ||
| 25 | |||
| 26 | =cut | ||
| 27 | has 'credits_spent' => ( | ||
| 28 | is => 'ro' | ||
| 29 | , isa => 'WebService::MyGengo::Num' | ||
| 30 | , required => 1 | ||
| 31 | , coerce => 1 | ||
| 32 | ); | ||
| 33 | |||
| 34 | =head2 user_since (DateTime) | ||
| 35 | |||
| 36 | The date at which this Account was registered with myGengo. | ||
| 37 | |||
| 38 | =cut | ||
| 39 | has 'user_since' => ( | ||
| 40 | is => 'ro' | ||
| 41 | , isa => 'WebService::MyGengo::DateTime' | ||
| 42 | , coerce => 1 | ||
| 43 | , required => 1 | ||
| 44 | ); | ||
| 45 | |||
| 46 | =head2 credits (Num) | ||
| 47 | |||
| 48 | A decimal figure representing the number of credits remaining to be used by | ||
| 49 | the Account. | ||
| 50 | |||
| 51 | =cut | ||
| 52 | has 'credits' => ( | ||
| 53 | is => 'ro' | ||
| 54 | , isa => 'WebService::MyGengo::Num' | ||
| 55 | , required => 1 | ||
| 56 | , coerce => 1 | ||
| 57 | ); | ||
| 58 | |||
| 59 | |||
| 60 | __PACKAGE__->meta->make_immutable(); | ||
| 61 | 1; | ||
| 62 | |||
| 63 | =head2 SEE ALSO | ||
| 64 | |||
| 65 | L<http://mygengo.com/api/developer-docs/methods/account-balance-get/> | ||
| 66 | |||
| 67 | L<http://mygengo.com/api/developer-docs/methods/account-stats-get/> | ||
| 68 | |||
| 69 | =head1 AUTHOR | ||
| 70 | |||
| 71 | Nathaniel Heinrichs | ||
| 72 | |||
| 73 | =head1 LICENSE | ||
| 74 | |||
| 75 | Copyright (c) 2011, Nathaniel Heinrichs <nheinric-at-cpan.org>. | ||
| 76 | All rights reserved. | ||
| 77 | |||
| 78 | This library is free software. You can redistribute it and/or modify | ||
| 79 | it under the same terms as Perl itself. | ||
| 80 | |||
| 81 | =cut | ||