OAuth/Lite2/Model/AccessToken.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 28 / 28 CC 2 SCAR 2.9
CC
2
Cov
100%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« OAuth/Lite2/Server/Error.pm ↑ Summary OAuth/Lite2/Model/AuthInfo.pm »
1 package OAuth::Lite2::Model::AccessToken;
2  
3 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 17 ▶use base 'Class::Accessor::Fast';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 17 __PACKAGE__->mk_accessors(qw(
9 auth_id
10 token
11 expires_in
12 secret
13 secret_type
14 created_on
15 ));
16  
17 17 ▶use Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 36 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
20 36 my $class = shift;
21 36 ▶ my @args = @_ == 1 ? %{$_[0]} : @_;
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 ? : 35 1 36
22 36 my %params = Params::Validate::validate_with(
23 params => \@args,
24 spec => {
25 auth_id => 1,
26 token => 1,
27 expires_in => { optional => 1 },
28 created_on => { optional => 1 },
29 secret => { optional => 1 },
30 secret_type => { optional => 1 },
31 },
32 allow_extra => 1,
33 );
34 36 my $self = bless \%params, $class;
35 36 return $self;
36 }
37  
38  
39 =head1 NAME
40  
41 OAuth::Lite2::Model::AccessToken - model class that represents access token
42  
43 =head1 ACCESSORS
44  
45 =head2 auth_id
46  
47 Identifier of L<OAuth::Lite2::Model::AuthInfo>.
48  
49 =head2 token
50  
51 Access token string.
52  
53 =head2 expires_in
54  
55 Seconds to expires from 'created_on'
56  
57 =head2 created_on
58  
59 UNIX time when access token created.
60  
61 =head2 secret
62  
63 DEPRECATED.
64  
65 =head2 secret_type
66  
67 DEPRECATED.
68  
69 =head1 AUTHOR
70  
71 Lyo Kato, E<lt>lyo.kato@gmail.comE<gt>
72  
73 =head1 COPYRIGHT AND LICENSE
74  
75 Copyright (C) 2010 by Lyo Kato
76  
77 This library is free software; you can redistribute it and/or modify
78 it under the same terms as Perl itself, either Perl version 5.8.8 or,
79 at your option, any later version of Perl 5 you may have available.
80  
81 =cut
82  
83 17 1;
84  
« OAuth/Lite2/Server/Error.pm ↑ Summary OAuth/Lite2/Model/AuthInfo.pm »