Object::eBay::Currency

Object::eBay::Currency represents a currency used by eBay.
Download

Object::eBay::Currency Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Michael Hendricks
  • Publisher web site:
  • http://search.cpan.org/~mndrix/Object-eBay-0.0.3/lib/Object/eBay/Boolean.pm

Object::eBay::Currency Tags


Object::eBay::Currency Description

Object::eBay::Currency represents a currency used by eBay. Object::eBay::Currency represents a currency used by eBay.SYNOPSIS # assuming that $item is an Object::eBay::Item object my $price = $item->selling_status->current_price; # supports string, numeric and boolean context print "Going for $pricen"; # "Going for USD12.99" print "Bargain!n" if $price < 20; # numeric context print "Has pricen" if $price; # boolean context # accessor methods are also available my $currency_id = $price->currency_id; # just the currency ID my $value = $price->value; # same as numeric context my $string = $price->as_string; # same as string contextMany of eBay's API calls return values which represent an amount of a particular currency. Item prices are a good example. An Object::eBay::Currency object represents a particular quantity of a particular currency. Methods throughout Object::eBay return Currency objects where appropriate.As mentioned in the "SYNOPSIS" string, numeric and boolean context are supported. In numeric context, the object evaluates to the amount of currency represented. In string context, the object evaluates to a string which represents the currency and the quantity both (see "as_string" for details). Boolean context returns the same value as numeric context. This overloading of boolean context makes Object::eBay::Currency objects behave as expected in boolean context instead of returning true all the time.


Object::eBay::Currency Related Software