line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Class Generic - ~/lib/Class/Generic.pm |
3
|
|
|
|
|
|
|
## Version v0.1.1 |
4
|
|
|
|
|
|
|
## Copyright(c) 2022 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2022/03/07 |
7
|
|
|
|
|
|
|
## Modified 2022/03/08 |
8
|
|
|
|
|
|
|
## All rights reserved |
9
|
|
|
|
|
|
|
## |
10
|
|
|
|
|
|
|
## This program is free software; you can redistribute it and/or modify it |
11
|
|
|
|
|
|
|
## under the same terms as Perl itself. |
12
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
BEGIN |
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
use strict; |
16
|
2
|
|
|
2
|
|
216826
|
use warnings; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
52
|
|
17
|
2
|
|
|
2
|
|
13
|
use parent qw( Module::Generic ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
51
|
|
18
|
2
|
|
|
2
|
|
19
|
our $VERSION = 'v0.1.1'; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
26
|
|
19
|
2
|
|
|
2
|
|
25959211
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=encoding utf-8 |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 NAME |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Class::Generic - Class Generic |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SYNOPSIS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
use parent qw( Class::Generic ) |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub init |
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
my $self = shift( @_ ); |
37
|
|
|
|
|
|
|
return( $self->SUPER::init( @_ ) ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $array = Class::Array->new( $something ); |
41
|
|
|
|
|
|
|
my $array = Class::Array->new( [$something] ); |
42
|
|
|
|
|
|
|
my $hash = Class::Assoc->new; |
43
|
|
|
|
|
|
|
my $bool = Class::Boolean->new; |
44
|
|
|
|
|
|
|
my $dt = Class::DateTime->new( $datetime_object ); |
45
|
|
|
|
|
|
|
# Sets implicitly a default DateTime object |
46
|
|
|
|
|
|
|
my $dt = Class::DateTime->new; |
47
|
|
|
|
|
|
|
my $ex = Class::Exception->new( message => "Oh no", code => 500 ); |
48
|
|
|
|
|
|
|
my $file = Class::File->new( '/some/where/file.txt' ); |
49
|
|
|
|
|
|
|
my $finfo = Class::Finfo->new( '/some/where/file.txt' ); |
50
|
|
|
|
|
|
|
my $null = Class::NullChain->new; |
51
|
|
|
|
|
|
|
my $num = Class::Number->new( 10 ); |
52
|
|
|
|
|
|
|
my $str = Class::Scalar->new( 'Some string' ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# For details on the api provided, please check each of the module documentation. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 VERSION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
v0.1.1 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This package inherits all its features from L<Module::Generic> and provides a generic framework of methods to inherit from and speed up development. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 METHODS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
See L<Module::Generic> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 AUTHOR |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 SEE ALSO |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
L<Class::Generic>, L<Class::Array>, L<Class::Scalar>, L<Class::Number>, L<Class::Boolean>, L<Class::Assoc>, L<Class::File>, L<Class::DateTime>, L<Class::Exception>, L<Class::Finfo>, L<Class::NullChain>, L<Class::DateTime> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Copyright(c) 2022 DEGUEST Pte. Ltd. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
81
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |