ILS/RecordedBooks/PartnerPatron.pm

filter: Statementstmt 53.8% 14 / 26 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 50.0% 2 / 4 totaltotal 47.6% 20 / 42 CC 3 SCAR 15.3
CC
3
Cov
47%
BUILD
12.0
circulation_action_base_url
2.0
patron_id
2.0
CRAP 4.6
« ILS/OverDrive/Library.pm ↑ Summary ILS/RecordedBooks/PartnerBase.pm »
1 package WebService::ILS::RecordedBooks::PartnerPatron;
2  
3 1 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 =encoding utf-8
6  
7 =head1 NAME
8  
9 WebService::ILS::RecordedBooks::PartnerPatron - RecordedBooks patner API
10 for an individual patron
11  
12 =head1 SYNOPSIS
13  
14 use WebService::ILS::RecordedBooks::PartnerPatron;
15  
16 =head1 DESCRIPTION
17  
18 L<WebService::ILS::RecordedBooks::PartnerPatron> - services
19 that use trusted partner credentials to operat on behalf of a specified patron
20  
21 See L<WebService::ILS::RecordedBooks::Partner>
22  
23 =cut
24  
25 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 1 ▶use parent qw(WebService::ILS::RecordedBooks::PartnerBase);
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 =head1 CONSTRUCTOR
30  
31 =head2 new (%params_hash or $params_hashref)
32  
33 =head3 Additional constructor params:
34  
35 =over 12
36  
37 =item C<user_id> => RecordedBooks user id (barcode), or email
38  
39 =back
40  
41 C<client_id> is either RecordedBooks id (barcode) or email
42  
43 =cut
44  
45 1 ▶use Class::Tiny qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
46 user_id
47 1 );
48  
49 1 __PACKAGE__->_set_param_spec({
50 user_id => { required => 1 },
51 });
52  
53 0 ▶sub BUILD {
Subroutine BUILD: not called CC=3 SCAR=24.8
Pod undocumented
54 0 my $self = shift;
55 0 my $params = shift;
56  
57 0 local $@;
58 0 ▶ my $patron_id = eval { $self->SUPER::patron_id($self->user_id) }
Branch: 2 branches
BranchTrueFalseTotal
my $patron_id = eval { do { $self->SUPER::patron_id($self->user_id) } } or croak('Invalid user_id ' . $self->user_id . ($@ ? "\n$@" : "")) 0 0 0
$@ ? : 0 0 0
59 or croak "Invalid user_id ".$self->user_id.($@ ? "\n$@" : "");
60 0 $self->user_id($patron_id);
61 }
62  
63 0 ▶sub circulation_action_base_url {
Subroutine circulation_action_base_url: not called CC=1 SCAR=6.9
Pod undocumented
64 0 my $self = shift;
65  
66 0 return $self->library_action_base_url."/patrons/".$self->user_id;
67 }
68  
69 0 ▶sub patron_id {
Subroutine patron_id: not called CC=1 SCAR=6.9
Pod documented
70 0 my $self = shift;
71 0 return $self->user_id;
72 }
73  
74 0 ▶sub patron {
Subroutine patron: not called CC=1 SCAR=6.9
Pod documented
75 0 my $self = shift;
76 0 return {id => $self->user_id};
77 }
78  
79 =head1 NATIVE METHODS
80  
81 =head2 native_patron ()
82  
83 This method cannot be called
84  
85 =cut
86  
87 1 1;
88  
89 __END__
« ILS/OverDrive/Library.pm ↑ Summary ILS/RecordedBooks/PartnerBase.pm »