| 1 | package WebService::Affiliate::Voucher::BuyAt; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use DateTime::Format::MySQL; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | with 'WebService::Affiliate::Role::Voucher'; | |||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | WebService::Affiliate::Voucher::BuyAt - Buy At specific voucher code model. | ||||||||||
| 13 | |||||||||||
| 14 | =head1 VERSION | ||||||||||
| 15 | |||||||||||
| 16 | Version 0.01 | ||||||||||
| 17 | |||||||||||
| 18 | =cut | ||||||||||
| 19 | |||||||||||
| 20 | 1 | our $VERSION = '0.01_01'; | |||||||||
| 21 | |||||||||||
| 22 | 1 | $VERSION = eval $VERSION; | |||||||||
| 23 | |||||||||||
| 24 | =head1 SYNOPSIS | ||||||||||
| 25 | |||||||||||
| 26 | Models a Buy At voucher code. | ||||||||||
| 27 | |||||||||||
| 28 | =cut | ||||||||||
| 29 | |||||||||||
| 30 | =head1 DESCRIPTION | ||||||||||
| 31 | |||||||||||
| 32 | =cut | ||||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | =head1 METHODS | ||||||||||
| 37 | |||||||||||
| 38 | =head2 Attributes | ||||||||||
| 39 | |||||||||||
| 40 | =cut | ||||||||||
| 41 | |||||||||||
| 42 | 1 | has status => ( is => 'rw', isa => 'Str' ); | |||||||||
| 43 | 1 | has discount => ( is => 'rw', isa => 'Str' ); | |||||||||
| 44 | 1 | has programme_status => ( is => 'rw', isa => 'Str' ); | |||||||||
| 45 | 1 | has _added => ( is => 'rw', isa => 'Str' ); | |||||||||
| 46 | 1 | has added => ( is => 'rw', isa => 'Maybe[DateTime]', lazy => 1, builder => '_build_added' ); | |||||||||
| 47 | 1 | has creative => ( is => 'rw', isa => 'Str' ); | |||||||||
| 48 | 1 | has sms_code => ( is => 'rw', isa => 'Str' ); | |||||||||
| 49 | |||||||||||
| 50 | sub _build_added | ||||||||||
| 51 | 0 | ▶ | { | ||||||||
|
Subroutine
_build_added: not called CC=4 SCAR=30.0
| |||||||||||
| 52 | 0 | my ($self) = @_; | |||||||||
| 53 | |||||||||||
| 54 | 0 | ▶ | return undef if ! $self->_added; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | |||||||||||
| 56 | 0 | ▶ | return DateTime::Format::MySQL->parse_datetime( $self->_added ) if $self->_added =~ /^\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | 0 | ▶ | return DateTime::Format::MySQL->parse_datetime( $self->_added . ':00' ) if $self->_added =~ /^\d\d\d\d\-\d\d\-\d\d \d\d:\d\d$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | } | ||||||||||
| 59 | |||||||||||
| 60 | =head1 METHODS | ||||||||||
| 61 | |||||||||||
| 62 | =head2 Class Methods | ||||||||||
| 63 | |||||||||||
| 64 | =head3 new | ||||||||||
| 65 | |||||||||||
| 66 | |||||||||||
| 67 | =cut | ||||||||||
| 68 | |||||||||||
| 69 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||
| 70 | |||||||||||
| 71 | =head1 AUTHOR | ||||||||||
| 72 | |||||||||||
| 73 | Rob Brown, C<< <rob at intelcompute.com> >> | ||||||||||
| 74 | |||||||||||
| 75 | =head1 BUGS | ||||||||||
| 76 | |||||||||||
| 77 | Please report any bugs or feature requests to C<bug-webservice-affiliate at rt.cpan.org>, or through | ||||||||||
| 78 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-Affiliate>. I will be notified, and then you'll | ||||||||||
| 79 | automatically be notified of progress on your bug as I make changes. | ||||||||||
| 80 | |||||||||||
| 81 | =head1 SUPPORT | ||||||||||
| 82 | |||||||||||
| 83 | You can find documentation for this module with the perldoc command. | ||||||||||
| 84 | |||||||||||
| 85 | perldoc WebService::Affiliate | ||||||||||
| 86 | |||||||||||
| 87 | You can also look for information at: | ||||||||||
| 88 | |||||||||||
| 89 | =over 4 | ||||||||||
| 90 | |||||||||||
| 91 | =item * RT: CPAN's request tracker (report bugs here) | ||||||||||
| 92 | |||||||||||
| 93 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=WebService-Affiliate> | ||||||||||
| 94 | |||||||||||
| 95 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||
| 96 | |||||||||||
| 97 | L<http://annocpan.org/dist/WebService-Affiliate> | ||||||||||
| 98 | |||||||||||
| 99 | =item * CPAN Ratings | ||||||||||
| 100 | |||||||||||
| 101 | L<http://cpanratings.perl.org/d/WebService-Affiliate> | ||||||||||
| 102 | |||||||||||
| 103 | =item * Search CPAN | ||||||||||
| 104 | |||||||||||
| 105 | L<http://search.cpan.org/dist/WebService-Affiliate/> | ||||||||||
| 106 | |||||||||||
| 107 | =back | ||||||||||
| 108 | |||||||||||
| 109 | =head1 ACKNOWLEDGEMENTS | ||||||||||
| 110 | |||||||||||
| 111 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 112 | |||||||||||
| 113 | Copyright 2012 Rob Brown. | ||||||||||
| 114 | |||||||||||
| 115 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 116 | under the terms of either: the GNU General Public License as published | ||||||||||
| 117 | by the Free Software Foundation; or the Artistic License. | ||||||||||
| 118 | |||||||||||
| 119 | See http://dev.perl.org/licenses/ for more information. | ||||||||||
| 120 | |||||||||||
| 121 | =cut | ||||||||||
| 122 | |||||||||||
| 123 | 1 | 1; # End of WebService::Affiliate | |||||||||