File Coverage

blib/lib/Stancer/Role/Name.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 25 25 100.0


line stmt bran cond sub pod time code
1             package Stancer::Role::Name;
2              
3 27     27   214069 use 5.020;
  27         139  
4 27     27   189 use strict;
  27         56  
  27         915  
5 27     27   160 use warnings;
  27         55  
  27         2448  
6              
7             # ABSTRACT: Name role
8             our $VERSION = '1.0.3'; # VERSION
9              
10 27     27   661 use Stancer::Core::Types qw(Maybe Name);
  27         58  
  27         2345  
11              
12 27     27   181 use Moo::Role;
  27         69  
  27         293  
13              
14             requires qw(_add_modified _attribute_builder);
15              
16 27     27   17516 use namespace::clean;
  27         81  
  27         269  
17              
18              
19             has name => (
20             is => 'rw',
21             isa => Maybe[Name],
22 32     32   3959 builder => sub { $_[0]->_attribute_builder('name') },
23             lazy => 1,
24             predicate => 1,
25             trigger => sub { $_[0]->_add_modified('name') },
26             );
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Stancer::Role::Name - Name role
39              
40             =head1 VERSION
41              
42             version 1.0.3
43              
44             =head1 ATTRIBUTES
45              
46             =head2 C<name>
47              
48             Read/Write 4 to 64 characters string.
49              
50             Element's name
51              
52             =head1 USAGE
53              
54             =head2 Logging
55              
56              
57              
58             We use the L<Log::Any> framework for logging events.
59             You may tell where it should log using any available L<Log::Any::Adapter> module.
60              
61             For example, to log everything to a file you just have to add a line to your script, like this:
62             #! /usr/bin/env perl
63             use Log::Any::Adapter (File => '/var/log/payment.log');
64             use Stancer::Role::Name;
65              
66             You must import C<Log::Any::Adapter> before our libraries, to initialize the logger instance before use.
67              
68             You can choose your log level on import directly:
69             use Log::Any::Adapter (File => '/var/log/payment.log', log_level => 'info');
70              
71             Read the L<Log::Any> documentation to know what other options you have.
72              
73             =cut
74              
75             =head1 SECURITY
76              
77             =over
78              
79             =item *
80              
81             Never, never, NEVER register a card or a bank account number in your database.
82              
83             =item *
84              
85             Always uses HTTPS in card/SEPA in communication.
86              
87             =item *
88              
89             Our API will never give you a complete card/SEPA number, only the last four digits.
90             If you need to keep track, use these last four digit.
91              
92             =back
93              
94             =cut
95              
96             =head1 BUGS
97              
98             Please report any bugs or feature requests on the bugtracker website
99             L<https://gitlab.com/wearestancer/library/lib-perl/-/issues> or by email to
100             L<bug-stancer@rt.cpan.org|mailto:bug-stancer@rt.cpan.org>.
101              
102             When submitting a bug or request, please include a test-file or a
103             patch to an existing test-file that illustrates the bug or desired
104             feature.
105              
106             =head1 AUTHOR
107              
108             Joel Da Silva <jdasilva@cpan.org>
109              
110             =head1 COPYRIGHT AND LICENSE
111              
112             This software is Copyright (c) 2018-2024 by Stancer / Iliad78.
113              
114             This is free software, licensed under:
115              
116             The Artistic License 2.0 (GPL Compatible)
117              
118             =cut