The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Object::eBay::Boolean - Represents a boolean return value

SYNOPSIS

    # assuming that $item is an Object::eBay::Item object
    my $private = $item->seller->is_feedback_private();
    
    # In string context, yields 'true' or 'false'
    print "Is the feedback private? $private\n";
    
    # In boolean context, yields 1 or 0
    if ($private) {
        print "Feedback is private\n";
    }
    else {
        print "Feedback is public\n";
    }

DESCRIPTION

Many of eBay's API calls return boolean (true/false) values. An Object::eBay::Boolean object represents this boolean return value in a context-aware way. In boolean context, the value is simply a boolean value as expected. In string context, the value is eBay's literal 'true' or 'false' value.

METHODS

true

A class method that returns a new Object::eBay::Boolean object representing true.

false

A class method that returns a new Object::eBay::Boolean object representing false.

as_boolean

This method implements the boolean context. Namely

    if ( $x->as_boolean() ) { ... }

is the same as

    if ($x) { ... }

as_string

This method implements the string context. Namely

    print "Example: " . $x->as_string() . "\n";

is the same as

    print "Example: $x\n";

DIAGNOSTICS

Invalid boolean value '%s'

If an Object::eBay::Boolean object is constructed with a value other than 'true' or 'false', this exception is thrown. Seeing this exception most likely indicates an error (or change) in eBay's XML response.

CONFIGURATION AND ENVIRONMENT

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

DEPENDENCIES

  • Class::Std

INCOMPATIBILITIES

None known.

BUGS AND LIMITATIONS

Please report any bugs or feature requests to bug-object-ebay 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

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

    perldoc Object::eBay;

You can also look for information at:

ACKNOWLEDGEMENTS

AUTHOR

Michael Hendricks <michael@ndrix.org>

LICENSE AND COPYRIGHT

Copyright (c) 2006 Michael Hendricks (<michael@ndrix.org>). All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.