File Coverage

blib/lib/Finance/LocalBitcoins/API/Request/TradeBook.pm
Criterion Covered Total %
statement 31 31 100.0
branch 1 2 50.0
condition n/a
subroutine 14 14 100.0
pod 0 8 0.0
total 46 55 83.6


line stmt bran cond sub pod time code
1             package Finance::LocalBitcoins::API::Request::TradeBook;
2 1     1   6 use base qw(Finance::LocalBitcoins::API::Request);
  1         1  
  1         91  
3 1     1   6 use strict;
  1         1  
  1         34  
4              
5 1     1   5 use constant URL => 'https://localbitcoins.com/bitcoincharts/%s/trades.json';
  1         2  
  1         52  
6 1     1   12 use constant ATTRIBUTES => qw(since);
  1         1  
  1         48  
7 1     1   5 use constant REQUEST_TYPE => 'GET';
  1         2  
  1         46  
8 1     1   6 use constant IS_PRIVATE => 0;
  1         1  
  1         272  
9              
10             sub init {
11 1     1 0 3 my $self = shift;
12 1         4 my %args = @_;
13 1 50       12 $self->currency($args{currency}) if exists $args{currency};
14 1         9 return $self->SUPER::init(@_);
15             }
16              
17 3     3 0 5 sub currency { my $self = shift; $self->get_set(@_) }
  3         153  
18 1     1 0 3 sub since { my $self = shift; $self->get_set(@_) }
  1         4  
19 1     1 0 5 sub url { sprintf URL, shift->currency }
20 1     1 0 4 sub is_ready_to_send { defined shift->currency }
21 2     2 0 8 sub attributes { ATTRIBUTES }
22 3     3 0 16 sub request_type { REQUEST_TYPE }
23 2     2 0 12 sub is_private { IS_PRIVATE }
24              
25             1;
26              
27             __END__