blib/lib/Net/OATH/Server/Lite/DataHandler.pm

filter: Statementstmt 46.1% 12 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 36.3% 4 / 11 Podpod 88.8% 8 / 9 totaltotal 52.1% 24 / 46 SCAR 1.5
CC
1
Cov
46%
request
2.0
create_id
2.0
create_secret
2.0
CRAP 1.2
« blib/lib/Net/OATH/Server/Lite/Error.pm ↑ Summary Build »
1 package Net::OATH::Server::Lite::DataHandler;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 Net::OATH::Server::Lite::DataHandler - Base class that specifies interface for data handler for your server.
9  
10 =head1 DESCRIPTION
11  
12 This connects Net::OATH::Server::Lite library to your service.
13 This specifies an interface to handle data stored in your application.
14 You must inherit this and implement the subroutines according to the interface contract.
15  
16 =head1 SYNOPSIS
17  
18 package YourDataHandler;
19 use strict;
20 use warnings;
21  
22 use parent 'Net::OATH::Server::Lite::DataHandler';
23  
24 =cut
25  
26 sub new {
27 49 ▶ my ($class, %args) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
28 49 my $self = bless { request => undef, %args }, $class;
29 49 $self->init;
30 49 $self;
31 }
32  
33 =head1 METHODS
34  
35 =head2 init
36  
37 This method can be implemented to initialize your subclass.
38  
39 =cut
40  
41 sub init {
42 49 ▶ my $self = shift;
Subroutine init: called CC=1 SCAR=0.0
Pod documented
43 # template method
44 }
45  
46 =head1 INTERFACES
47  
48 =head2 request
49  
50 Returns <Plack::Request> object.
51  
52 =cut
53  
54 sub request {
55 0 ▶ my $self = shift;
Subroutine request: not called CC=1 SCAR=6.9
Pod documented
56 0 return $self->{request};
57 }
58  
59 =head2 create_id
60  
61 Returns identifier of new user object.
62  
63 =cut
64  
65 sub create_id {
66 0 ▶ my ($self) = @_;
Subroutine create_id: not called CC=1 SCAR=6.9
Pod documented
67 0 die "abstract method";
68 }
69  
70 =head2 create_secret
71  
72 Returns raw secret of new user object.
73  
74 =cut
75  
76 sub create_secret {
77 0 ▶ my ($self) = @_;
Subroutine create_secret: not called CC=1 SCAR=6.9
Pod documented
78 0 die "abstract method";
79 }
80  
81 # For Register
82  
83 =head2 insert_user( $user )
84  
85 Inserts new user object to your datastore and returnes result as a boolean.
86  
87 =cut
88  
89 sub insert_user {
90 0 ▶ my ($self, $user) = @_;
Subroutine insert_user: not called CC=1 SCAR=6.9
Pod documented
91 0 die "abstract method";
92 }
93  
94 # For Login and User Object
95  
96 =head2 select_user( $id )
97  
98 Return user object which is found by $id.
99  
100 =cut
101  
102 sub select_user {
103 0 ▶ my ($self, $id) = @_;
Subroutine select_user: not called CC=1 SCAR=6.9
Pod documented
104 0 die "abstract method";
105 }
106  
107 # For User Object
108  
109 =head2 update_user( $user )
110  
111 Updates user object on your datastore and returnes result as a boolean.
112  
113 =cut
114  
115 sub update_user {
116 0 ▶ my ($self, $user) = @_;
Subroutine update_user: not called CC=1 SCAR=6.9
Pod documented
117 0 die "abstract method";
118 }
119  
120 =head2 delete_user( $id )
121  
122 Deletes user object which is found by $id on your datastore and returnes result as a boolean.
123  
124 =cut
125  
126 sub delete_user {
127 0 ▶ my ($self, $id) = @_;
Subroutine delete_user: not called CC=1 SCAR=6.9
Pod documented
128 0 die "abstract method";
129 }
130  
131 6 1;
« blib/lib/Net/OATH/Server/Lite/Error.pm ↑ Summary Build »