]> iEval git - www-backpacktf.git/blame - lib/WWW/BackpackTF/MarketItem.pm
Bump version and update Changes
[www-backpacktf.git] / lib / WWW / BackpackTF / MarketItem.pm
CommitLineData
fa7f4d7f
MG
1package WWW::BackpackTF::MarketItem;
2
3use 5.014000;
4use strict;
5use warnings;
3a7fbf42 6our $VERSION = '0.002001';
fa7f4d7f
MG
7
8sub new{
9 my ($class, $name, $content) = @_;
10 $content->{name} = $name;
11 bless $content, $class
12}
13
14sub name { shift->{name} }
15sub last_updated { shift->{last_updated} }
16sub quantity { shift->{quantity} }
17sub value { shift->{value} }
18
191;
20__END__
21
22=encoding utf-8
23
24=head1 NAME
25
26WWW::BackpackTF::MarketItem - Class representing market item information
27
28=head1 SYNOPSIS
29
30 use WWW::BackpackTF;
31 use Data::Dumper qw/Dumper/;
32 use POSIX qw/strftime/;
33
34 my $bp = WWW::BackpackTF->new(key => '...');
35 my @items = $bp->get_market_prices;
36 my $item = $items[0];
37 say 'Name: ', $item->name;
38 say strftime 'Last updated on: %c', localtime $item->last_updated;
39 say 'Quantity available on market: ', $item->quantity;
40 say 'Value of item: $', sprintf '%.2f', $item->value / 100;
41
42=head1 DESCRIPTION
43
44WWW::BackpackTF::MarketItem is a class representing Steam Community
45Market price information about an item.
46
47=head2 METHODS
48
49=over
50
51=item B<name>
52
53The name of the item.
54
55=item B<last_updated>
56
57The timestamp of this information, as seconds since unix epoch.
58
59=item B<quantity>
60
61How many items of this kind are there on the SCM.
62
63=item B<value>
64
65The price this item is selling for, in cents (USD 0.01).
66
67=back
68
fa7f4d7f
MG
69=head1 SEE ALSO
70
71L<http://backpack.tf/api/docs/IGetMarketPrices>
72
73=head1 AUTHOR
74
75Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
76
77=head1 COPYRIGHT AND LICENSE
78
3a7fbf42 79Copyright (C) 2014-2017 by Marius Gavrilescu
fa7f4d7f
MG
80
81This library is free software; you can redistribute it and/or modify
82it under the same terms as Perl itself, either Perl version 5.18.2 or,
83at your option, any later version of Perl 5 you may have available.
84
85
86=cut
This page took 0.027464 seconds and 4 git commands to generate.