From 3282be229999dc36c197b264d63063a18d136331 Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Sun, 11 Nov 2007 06:55:13 +0000 Subject: * Update installation list with required modules * Remove unused/doubled provided external perl moduls --- lib/Net/Amazon/Attribute/Review.pm | 104 -------------------------- lib/Net/Amazon/Attribute/ReviewSet.pm | 137 ---------------------------------- 2 files changed, 241 deletions(-) delete mode 100644 lib/Net/Amazon/Attribute/Review.pm delete mode 100644 lib/Net/Amazon/Attribute/ReviewSet.pm (limited to 'lib/Net/Amazon/Attribute') diff --git a/lib/Net/Amazon/Attribute/Review.pm b/lib/Net/Amazon/Attribute/Review.pm deleted file mode 100644 index 5a5d094..0000000 --- a/lib/Net/Amazon/Attribute/Review.pm +++ /dev/null @@ -1,104 +0,0 @@ -###################################################################### -package Net::Amazon::Attribute::Review; -###################################################################### -use warnings; -use strict; -use Log::Log4perl qw(:easy); -use base qw(Net::Amazon); - -__PACKAGE__->make_accessor($_) for qw(rating summary comment); - -################################################## -sub new { -################################################## - my($class, %options) = @_; - - my $self = { - rating => "", - summary => "", - comment => "", - %options, - }; - - bless $self, $class; -} - -################################################## -sub init_via_xmlref { -################################################## - my($self, $xmlref) = @_; - - for(qw(Rating Summary Comment)) { - my $method = lc($_); - if($xmlref->{$_}) { - $self->$method($xmlref->{$_}); - } else { - #LOGWARN "No '$_'"; - return undef; - } - } -} - -1; - -__END__ - -=head1 NAME - -Net::Amazon::Attribute::Review - Customer Review Class - -=head1 SYNOPSIS - - use Net::Amazon::Attribute::Review; - my $rev = Net::Amazon::Attribute::Review->new( - 'rating' => $rating, - 'summary' => $summary, - 'comment' => $comment, - ); - -=head1 DESCRIPTION - -C holds customer reviews. - -=head2 METHODS - -=over 4 - -=item rating() - -Accessor for the numeric value of the rating. - -=item summary() - -Accessor for the string value of the summary. - -=item comment() - -Accessor for the string value of the customer comment. - -=back - -=head1 SEE ALSO - -=head1 AUTHOR - -Mike Schilli, Em@perlmeister.comE - -=head1 COPYRIGHT AND LICENSE - -Copyright 2003 by Mike Schilli Em@perlmeister.comE - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut - -__END__ - - 4.33 - 6 - - 4 - Good introduction to Perl, and great reference - From its corny title you might expect another one of those - diff --git a/lib/Net/Amazon/Attribute/ReviewSet.pm b/lib/Net/Amazon/Attribute/ReviewSet.pm deleted file mode 100644 index 29a34e6..0000000 --- a/lib/Net/Amazon/Attribute/ReviewSet.pm +++ /dev/null @@ -1,137 +0,0 @@ -###################################################################### -package Net::Amazon::Attribute::ReviewSet; -###################################################################### -use warnings; -use strict; -use Log::Log4perl qw(:easy); -use Net::Amazon::Attribute::Review; -use base qw(Net::Amazon); - -__PACKAGE__->make_accessor($_) for qw(average_customer_rating total_reviews); - -################################################## -sub new { -################################################## - my($class, %options) = @_; - - my $self = { - reviews => [], # list of reviews - }; - - bless $self, $class; -} - -########################################### -sub add_review { -########################################### - my($self, $review) = @_; - - if(ref $review ne "Net::Amazon::Attribute::Review") { - warn "add_review called with type ", ref $review; - return undef; - } - - push @{$self->{reviews}}, $review; -} - -########################################### -sub reviews { -########################################### - my($self) = @_; - - return @{$self->{reviews}}; -} - -################################################## -sub init_via_xmlref { -################################################## - my($self, $xmlref) = @_; - - my @pairs = qw(AvgCustomerRating average_customer_rating - TotalCustomerReviews total_reviews); - - while(my($field, $method) = splice @pairs, 0, 2) { - - if(defined $xmlref->{$field}) { - DEBUG "Setting $field via $method to $xmlref->{$field}"; - $self->$method($xmlref->{$field}); - } else { - LOGWARN "No '$field'"; - return undef; - } - } - - if(ref $xmlref->{CustomerReview} ne "ARRAY") { - $xmlref->{CustomerReview} = [$xmlref->{CustomerReview}]; - } - - for my $review_xmlref (@{$xmlref->{CustomerReview}}) { - my $review = Net::Amazon::Attribute::Review->new(); - $review->init_via_xmlref($review_xmlref); - DEBUG "Adding review ", $review->summary(); - $self->add_review($review); - } -} - -1; - -__END__ - -=head1 NAME - -Net::Amazon::Attribute::ReviewSet - A set of customer reviews - -=head1 SYNOPSIS - - use Net::Amazon::Attribute::ReviewSet; - my $rev = Net::Amazon::Attribute::Review->new( - average_customer_rating => $avg, - total_reviews => $total, - ); - -=head1 DESCRIPTION - -C holds a list of customer -reviews, each of type C. - -=head2 METHODS - -=over 4 - -=item C<< $self->reviews() >> - -Returns a list of C objects. - -=item C<< $self->average_customer_rating() >> - -Accessor for the average customer rating, a numeric value. - -=item C<< $self->total_reviews() >> - -Accessor for the total number of reviews. Please note that this -might not be equal to the number of reviews held in the list, since -there might be less customer reviews than total reviews (reviews -can also be non-customer-reviews, but they're not available by -the web service as of Aug 2003). - -=item C<< $self->add_review($rev) >> - -Add a C object to the list. -(Used internally only). - -=back - -=head1 SEE ALSO - -=head1 AUTHOR - -Mike Schilli, Em@perlmeister.comE - -=head1 COPYRIGHT AND LICENSE - -Copyright 2003 by Mike Schilli Em@perlmeister.comE - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut -- cgit v1.2.3