line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Goo::Action; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
# Nigel Hamilton |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2005 |
7
|
|
|
|
|
|
|
# All Rights Reserved |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
10
|
|
|
|
|
|
|
# Filename: GooAction.pm |
11
|
|
|
|
|
|
|
# Description: Remember an action in The Goo |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Date Change |
14
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
# 20/08/2005 Auto generated file |
16
|
|
|
|
|
|
|
# 20/08/2005 Needed to pass around as an Object |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
############################################################################### |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
5
|
use Goo::Object; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# GooAction isa Object |
25
|
1
|
|
|
1
|
|
5
|
use base qw(Goo::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
418
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
############################################################################### |
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
# new - construct a goo_action object |
31
|
|
|
|
|
|
|
# |
32
|
|
|
|
|
|
|
############################################################################### |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
1
|
|
my ($class, $params) = @_; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $this = $class->SUPER::new(); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# create a GooAction object |
41
|
0
|
|
|
|
|
|
$this->{actionid} = $params->{actionid}; |
42
|
0
|
|
|
|
|
|
$this->{action} = $params->{action}; |
43
|
0
|
|
|
|
|
|
$this->{who} = $params->{who}; |
44
|
0
|
|
|
|
|
|
$this->{thing} = $params->{thing}; |
45
|
0
|
|
|
|
|
|
$this->{actiontime} = $params->{actiontime}; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return $this; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
############################################################################### |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
# get_action - return the description of the action performed |
55
|
|
|
|
|
|
|
# |
56
|
|
|
|
|
|
|
############################################################################### |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub get_action { |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $action = $this->{action}; |
63
|
0
|
|
|
|
|
|
$action =~ s/\[//; |
64
|
0
|
|
|
|
|
|
$action =~ s/\]//; |
65
|
0
|
|
|
|
|
|
return $action; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
############################################################################### |
71
|
|
|
|
|
|
|
# |
72
|
|
|
|
|
|
|
# get_user - who did the action? |
73
|
|
|
|
|
|
|
# |
74
|
|
|
|
|
|
|
############################################################################### |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub get_user { |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
return $this->{who}; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
############################################################################### |
86
|
|
|
|
|
|
|
# |
87
|
|
|
|
|
|
|
# get_when - when did they do the action? |
88
|
|
|
|
|
|
|
# |
89
|
|
|
|
|
|
|
############################################################################### |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub get_when { |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
return $this->{actiontime}; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
############################################################################### |
101
|
|
|
|
|
|
|
# |
102
|
|
|
|
|
|
|
# get_short_thing - what thing did they do the action on? |
103
|
|
|
|
|
|
|
# |
104
|
|
|
|
|
|
|
############################################################################### |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub get_short_thing { |
107
|
|
|
|
|
|
|
|
108
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
my $short_thing = $this->{thing}; |
111
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
$short_thing =~ s/.*\///; |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
return $short_thing; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
############################################################################### |
120
|
|
|
|
|
|
|
# |
121
|
|
|
|
|
|
|
# get_thing - what thing did they do the action on? |
122
|
|
|
|
|
|
|
# |
123
|
|
|
|
|
|
|
############################################################################### |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub get_thing { |
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
128
|
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
|
return $this->{thing}; |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
1; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
__END__ |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 NAME |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Goo::Action - A Goo action |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head1 SYNOPSIS |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
use Goo::Action; |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 DESCRIPTION |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Store who performed an action, when they did it, and to which Thing. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head1 METHODS |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=over |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item new |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
constructor |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item get_action |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Return the description of the action performed |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item get_user |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
who did the action? |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item get_when |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
when did they do the action? |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item get_short_thing |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
eturn the short name of the Thing they did the action on? |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item get_thing |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
return the name and location of the Thing they did the action on? |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=back |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 AUTHOR |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head1 SEE ALSO |
186
|
|
|
|
|
|
|
|