File Coverage

blib/lib/Business/Giropay/Response/Issuer.pm
Criterion Covered Total %
statement 10 12 83.3
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 15 20 75.0


line stmt bran cond sub pod time code
1             package Business::Giropay::Response::Issuer;
2              
3             =head1 NAME
4              
5             Business::Giropay::Response::Issuer - response object for L
6              
7             =cut
8              
9 1     1   16202 use Business::Giropay::Types qw/Map Maybe Str/;
  1         3  
  1         7  
10 1     1   1079 use Moo;
  1         8401  
  1         6  
11             with 'Business::Giropay::Role::Response';
12 1     1   1402 use namespace::clean;
  1         7481  
  1         3  
13              
14             =head1 ATTRIBUTES
15              
16             See L for attributes common to
17             all request classes.
18              
19             =head2 issuers
20              
21             A hash reference of issuer banks with BIC as key and name as value.
22              
23             =cut
24              
25             has issuers => (
26             is => 'lazy',
27             isa => Maybe [ Map [ Str, Str ] ],
28             init_arg => undef,
29             );
30              
31             sub _build_issuers {
32 1     1   662 shift->data->{issuer};
33             }
34              
35             =head1 METHODS
36              
37             See L for methods in addition to
38             the following:
39              
40             =head2 has_bic $bic_code
41              
42             Returns true if C<$bic_code> exists as a key in L.
43              
44             =cut
45              
46             sub has_bic {
47 0     0 1   my ( $self, $bic ) = @_;
48 0 0         exists $self->issuers->{$bic} ? 1 : 0;
49             }
50              
51             1;