Object::eBay::User - Represents an eBay user


Object-eBay documentation Contained in the Object-eBay distribution.

Index


Code Index:

NAME

Top

Object::eBay::User - Represents an eBay user

SYNOPSIS

Top

    # Assuming that Object::eBay has been initialized
    use Object::eBay::User;
    my $user = Object::eBay::User->new({ user_id => 'example' });
    print "Feedback Score: ", $user->feedback_score(), "\n";

DESCRIPTION

Top

Represents an eBay user.

METHODS

Top

new

Requires a single hashref as the argument. The hashref should contain a key 'user_id' whose value is the ID of the user you want the new object to represent.

email

Returns the user's email address if available. If it's not available, returns undef.

feedback_score

Returns an integer indicating the user's feedback score.

is_feedback_private

Returns an Object::eBay::Boolean object representing 'true' if the user's feedback score is private. Returns 'false' if the user's feedback score is public.

user_id

Returns the user's name (username).

DIAGNOSTICS

Top

None

CONFIGURATION AND ENVIRONMENT

Top

Object::eBay::User requires no configuration files or environment variables.

DEPENDENCIES

Top

* Class::Std
* Object::eBay

INCOMPATIBILITIES

Top

None known.

BUGS AND LIMITATIONS

Top

Please report any bugs or feature requests to bug-object-ebay-user at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Object-eBay. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Object::eBay

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Object-eBay

* CPAN Ratings

http://cpanratings.perl.org/d/Object-eBay

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Object-eBay

* Search CPAN

http://search.cpan.org/dist/Object-eBay

ACKNOWLEDGEMENTS

Top

AUTHOR

Top

Michael Hendricks <michael@ndrix.org>

LICENSE AND COPYRIGHT

Top


Object-eBay documentation Contained in the Object-eBay distribution.

package Object::eBay::User;
our $VERSION = '0.4.0';

use Class::Std; {
    use warnings;
    use strict;
    use base qw( Object::eBay );

    sub api_call       { "GetUser" };
    sub response_field { "User"    };

    __PACKAGE__->simple_attributes(qw{
        FeedbackScore
        UserID
    });

    __PACKAGE__->complex_attributes({
        Email => {
            undefined_value_ok => 1,
            convert_value => sub {
                my $email = shift;
                return if defined($email) and $email eq 'Invalid Request';
                return $email;
            },
        },
        FeedbackPrivate => {
            class => 'Boolean',
        }
    });

    # name the boolean method with is_ to be consistent
    sub is_feedback_private { shift->feedback_private }

}

1;

__END__