| 1 | package Net::Lyskom::Person; | ||||||||||
| 2 | 1 | ▶ | use base qw{Net::Lyskom::Object}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Net::Lyskom::Util qw{:all}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Net::Lyskom::Time; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | =head1 NAME | ||||||||||
| 10 | |||||||||||
| 11 | Net::Lyskom::Person - object holding status for a person | ||||||||||
| 12 | |||||||||||
| 13 | =head1 SYNOPSIS | ||||||||||
| 14 | |||||||||||
| 15 | print "This user has written ",$obj->created_bytes/1024," kilobytes of texts."; | ||||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | =head1 DESCRIPTION | ||||||||||
| 19 | |||||||||||
| 20 | All methods in this object are read-only and take no arguments. Unless | ||||||||||
| 21 | noted otherwise, all methods return simple scalars. | ||||||||||
| 22 | |||||||||||
| 23 | =head2 Methods | ||||||||||
| 24 | |||||||||||
| 25 | =over | ||||||||||
| 26 | |||||||||||
| 27 | =item ->username() | ||||||||||
| 28 | |||||||||||
| 29 | =item ->last_login() | ||||||||||
| 30 | |||||||||||
| 31 | Returns L<Net::Lyskom::Time> object; | ||||||||||
| 32 | |||||||||||
| 33 | =item ->user_area() | ||||||||||
| 34 | |||||||||||
| 35 | =item ->total_time_present() | ||||||||||
| 36 | |||||||||||
| 37 | =item ->sessions() | ||||||||||
| 38 | |||||||||||
| 39 | =item ->created_lines() | ||||||||||
| 40 | |||||||||||
| 41 | =item ->created_bytes() | ||||||||||
| 42 | |||||||||||
| 43 | =item ->read_texts() | ||||||||||
| 44 | |||||||||||
| 45 | =item ->no_of_text_fetches() | ||||||||||
| 46 | |||||||||||
| 47 | =item ->created_persons() | ||||||||||
| 48 | |||||||||||
| 49 | =item ->created_confs() | ||||||||||
| 50 | |||||||||||
| 51 | =item ->first_created_local() | ||||||||||
| 52 | |||||||||||
| 53 | =item ->no_of_created_texts() | ||||||||||
| 54 | |||||||||||
| 55 | =item ->no_of_marks() | ||||||||||
| 56 | |||||||||||
| 57 | =item ->no_of_confs() | ||||||||||
| 58 | |||||||||||
| 59 | =item ->wheel() | ||||||||||
| 60 | |||||||||||
| 61 | =item ->admin() | ||||||||||
| 62 | |||||||||||
| 63 | =item ->statistic() | ||||||||||
| 64 | |||||||||||
| 65 | =item ->create_pers() | ||||||||||
| 66 | |||||||||||
| 67 | =item ->create_conf() | ||||||||||
| 68 | |||||||||||
| 69 | =item ->change_name() | ||||||||||
| 70 | |||||||||||
| 71 | =item ->unread_is_secret() | ||||||||||
| 72 | |||||||||||
| 73 | =back | ||||||||||
| 74 | |||||||||||
| 75 | =cut | ||||||||||
| 76 | |||||||||||
| 77 | # Accessors | ||||||||||
| 78 | 0 | ▶ | sub username {my $s = shift; return $s->{username}} | ||||||||
|
Subroutine
username: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 79 | 0 | ▶ | sub last_login {my $s = shift; return $s->{last_login}} | ||||||||
|
Subroutine
last_login: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 80 | 0 | ▶ | sub user_area {my $s = shift; return $s->{user_area}} | ||||||||
|
Subroutine
user_area: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 81 | 0 | ▶ | sub total_time_present {my $s = shift; return $s->{total_time_present}} | ||||||||
|
Subroutine
total_time_present: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 82 | 0 | ▶ | sub sessions {my $s = shift; return $s->{sessions}} | ||||||||
|
Subroutine
sessions: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 83 | 0 | ▶ | sub created_lines {my $s = shift; return $s->{created_lines}} | ||||||||
|
Subroutine
created_lines: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 84 | 0 | ▶ | sub created_bytes {my $s = shift; return $s->{created_bytes}} | ||||||||
|
Subroutine
created_bytes: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 85 | 0 | ▶ | sub read_texts {my $s = shift; return $s->{read_texts}} | ||||||||
|
Subroutine
read_texts: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 86 | 0 | ▶ | sub no_of_text_fetches {my $s = shift; return $s->{no_of_text_fetches}} | ||||||||
|
Subroutine
no_of_text_fetches: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 87 | 0 | ▶ | sub created_persons {my $s = shift; return $s->{created_persons}} | ||||||||
|
Subroutine
created_persons: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 88 | 0 | ▶ | sub created_confs {my $s = shift; return $s->{created_confs}} | ||||||||
|
Subroutine
created_confs: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 89 | 0 | ▶ | sub first_created_local_no {my $s = shift; return $s->{first_created_local_no}} | ||||||||
|
Subroutine
first_created_local_no: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 90 | 0 | ▶ | sub no_of_created_texts {my $s = shift; return $s->{no_of_created_texts}} | ||||||||
|
Subroutine
no_of_created_texts: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 91 | 0 | ▶ | sub no_of_marks {my $s = shift; return $s->{no_of_marks}} | ||||||||
|
Subroutine
no_of_marks: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 92 | 1 | ▶ | sub no_of_confs {my $s = shift; return $s->{no_of_confs}} | ||||||||
|
Subroutine
no_of_confs: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 93 | |||||||||||
| 94 | # Flags | ||||||||||
| 95 | 0 | ▶ | sub unread_is_secret {my $s = shift; return $s->{unread_is_secret}} | ||||||||
|
Subroutine
unread_is_secret: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 96 | |||||||||||
| 97 | # Privs | ||||||||||
| 98 | 0 | ▶ | sub wheel {my $s = shift; return $s->{wheel}} | ||||||||
|
Subroutine
wheel: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 99 | 0 | ▶ | sub admin {my $s = shift; return $s->{admin}} | ||||||||
|
Subroutine
admin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 100 | 0 | ▶ | sub statistic {my $s = shift; return $s->{statistic}} | ||||||||
|
Subroutine
statistic: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 101 | 0 | ▶ | sub create_pers {my $s = shift; return $s->{create_pers}} | ||||||||
|
Subroutine
create_pers: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 102 | 0 | ▶ | sub create_conf {my $s = shift; return $s->{create_conf}} | ||||||||
|
Subroutine
create_conf: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 103 | 0 | ▶ | sub change_name {my $s = shift; return $s->{change_name}} | ||||||||
|
Subroutine
change_name: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 104 | |||||||||||
| 105 | 1 | ▶ | sub new_from_stream { | ||||||||
|
Subroutine
new_from_stream: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 106 | 1 | my $s = {}; | |||||||||
| 107 | 1 | my $class = shift; | |||||||||
| 108 | 1 | my $ref = shift; | |||||||||
| 109 | |||||||||||
| 110 | 1 | ▶ | $class = ref($class) if ref($class); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 111 | 1 | bless $s,$class; | |||||||||
| 112 | |||||||||||
| 113 | 1 | $s->{username} = shift @{$ref}; | |||||||||
| 114 | 1 | my $privs = shift @{$ref}; | |||||||||
| 115 | 1 | my $flags = shift @{$ref}; | |||||||||
| 116 | 1 | $s->{last_login} = Net::Lyskom::Time->new_from_stream($ref); | |||||||||
| 117 | 1 | $s->{user_area} = shift @{$ref}; | |||||||||
| 118 | 1 | $s->{total_time_present} = shift @{$ref}; | |||||||||
| 119 | 1 | $s->{sessions} = shift @{$ref}; | |||||||||
| 120 | 1 | $s->{created_lines} = shift @{$ref}; | |||||||||
| 121 | 1 | $s->{created_bytes} = shift @{$ref}; | |||||||||
| 122 | 1 | $s->{read_texts} = shift @{$ref}; | |||||||||
| 123 | 1 | $s->{no_of_text_fetches} = shift @{$ref}; | |||||||||
| 124 | 1 | $s->{created_persons} = shift @{$ref}; | |||||||||
| 125 | 1 | $s->{created_confs} = shift @{$ref}; | |||||||||
| 126 | 1 | $s->{first_created_local} = shift @{$ref}; | |||||||||
| 127 | 1 | $s->{no_of_created_texts} = shift @{$ref}; | |||||||||
| 128 | 1 | $s->{no_of_marks} = shift @{$ref}; | |||||||||
| 129 | 1 | $s->{no_of_confs} = shift @{$ref}; | |||||||||
| 130 | |||||||||||
| 131 | ( | ||||||||||
| 132 | $s->{wheel}, | ||||||||||
| 133 | $s->{admin}, | ||||||||||
| 134 | $s->{statistic}, | ||||||||||
| 135 | $s->{create_pers}, | ||||||||||
| 136 | $s->{create_conf}, | ||||||||||
| 137 | $s->{change_name}, | ||||||||||
| 138 | 1 | ) = $privs =~ /./g; | |||||||||
| 139 | |||||||||||
| 140 | ( | ||||||||||
| 141 | $s->{unread_is_secret} | ||||||||||
| 142 | 1 | ) = $flags =~ /./g; | |||||||||
| 143 | |||||||||||
| 144 | 1 | return $s; | |||||||||
| 145 | } | ||||||||||
| 146 | |||||||||||
| 147 | 1 | 1; | |||||||||