blib/lib/Tags/HTML/Login/Button.pm

filter: Statementstmt 100% 32 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 1 / 1 totaltotal 100% 41 / 41 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Tags::HTML::Login::Button;
2  
3 5 ▶use base qw(Tags::HTML);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use Class::Utils qw(set_params split_params);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Error::Pure qw(err);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 our $VERSION = 0.04;
11  
12 # Constructor.
13 11 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
14 11 my ($class, @params) = @_;
15  
16 # Create object.
17 11 my ($object_params_ar, $other_params_ar) = split_params(
18 ['link', 'title'], @params);
19 11 my $self = $class->SUPER::new(@{$other_params_ar});
20  
21 # Login button link.
22 8 $self->{'link'} = 'login';
23  
24 # Login button title.
25 8 $self->{'title'} = 'LOGIN';
26  
27 # Process params.
28 8 set_params($self, @{$object_params_ar});
29  
30 # Object.
31 8 return $self;
32 }
33  
34 # Process 'Tags'.
35 2 ▶sub _process {
Subroutine _process: called CC=1 SCAR=0.0
36 2 my $self = shift;
37  
38 # Main content.
39 $self->{'tags'}->put(
40 ['a', 'class', 'outer'],
41  
42 ['b', 'div'],
43 ['a', 'class', 'login'],
44 ['b', 'a'],
45 ['a', 'href', $self->{'link'}],
46 2 ['d', $self->{'title'}],
47 ['e', 'a'],
48 ['e', 'div'],
49 );
50  
51 2 return;
52 }
53  
54 # Process 'CSS::Struct'.
55 1 ▶sub _process_css {
Subroutine _process_css: called CC=1 SCAR=0.0
56 1 my $self = shift;
57  
58 1 $self->{'css'}->put(
59 ['s', '.outer'],
60 ['d', 'position', 'fixed'],
61 ['d', 'top', '50%'],
62 ['d', 'left', '50%'],
63 ['d', 'transform', 'translate(-50%, -50%)'],
64 ['e'],
65  
66 ['s', '.login'],
67 ['d', 'text-align', 'center'],
68 ['e'],
69  
70 ['s', '.login a'],
71 ['d', 'text-decoration', 'none'],
72 ['d', 'background-image', 'linear-gradient(to bottom,#fff 0,#e0e0e0 100%)'],
73 ['d', 'background-repeat', 'repeat-x'],
74 ['d', 'border', '1px solid #adadad'],
75 ['d', 'border-radius', '4px'],
76 ['d', 'color', 'black'],
77 ['d', 'font-family', 'sans-serif!important'],
78 ['d', 'padding', '15px 40px'],
79 ['e'],
80  
81 ['s', '.login a:hover'],
82 ['d', 'background-color', '#e0e0e0'],
83 ['d', 'background-image', 'none'],
84 ['e'],
85 );
86  
87 1 return;
88 }
89  
90 5 1;
91  
92 __END__
↑ Summary