line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
24680
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Rubyish::Class; |
4
|
1
|
|
|
1
|
|
6
|
use base 'Rubyish::Module'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
519
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Rubyish::Attribute; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub import { |
9
|
|
|
|
|
|
|
my $caller = caller; |
10
|
|
|
|
|
|
|
__export_class_methods($caller); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub __export_class_methods { |
14
|
|
|
|
|
|
|
my ($package) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
no strict; |
17
|
|
|
|
|
|
|
*{$package . "::attr_accessor"} = *{Rubyish::Attribute::attr_accessor}; |
18
|
|
|
|
|
|
|
*{$package . "::attr_writer"} = *{Rubyish::Attribute::attr_writer}; |
19
|
|
|
|
|
|
|
*{$package . "::attr_reader"} = *{Rubyish::Attribute::attr_reader}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Rubyish::Class - The Class |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use MyClass; |
32
|
|
|
|
|
|
|
use Rubyish::Class; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
attr_accessor 'foo', 'bar', 'baz'; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 DESCRIPTION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
This module does very simple things so far. It provides a simple |
41
|
|
|
|
|
|
|
default constructor C method, and re-export C, |
42
|
|
|
|
|
|
|
C, and C into your current package. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SEE ALSO |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
L for the real implementation of those accessor |
47
|
|
|
|
|
|
|
generators. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 AUTHOR |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Kang-min Liu C<< >>, shelling C |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 LICENCE AND COPYRIGHT |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Copyright (c) 2008,2009, Kang-min Liu C<< >>. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This is free software, licensed under: |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
The MIT (X11) License |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
64
|
|
|
|
|
|
|
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
65
|
|
|
|
|
|
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
66
|
|
|
|
|
|
|
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER |
67
|
|
|
|
|
|
|
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
68
|
|
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE |
69
|
|
|
|
|
|
|
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH |
70
|
|
|
|
|
|
|
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL |
71
|
|
|
|
|
|
|
NECESSARY SERVICING, REPAIR, OR CORRECTION. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
74
|
|
|
|
|
|
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
75
|
|
|
|
|
|
|
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE |
76
|
|
|
|
|
|
|
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, |
77
|
|
|
|
|
|
|
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE |
78
|
|
|
|
|
|
|
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING |
79
|
|
|
|
|
|
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A |
80
|
|
|
|
|
|
|
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF |
81
|
|
|
|
|
|
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
82
|
|
|
|
|
|
|
SUCH DAMAGES. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|