line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Goo::ProfileOption; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
############################################################################### |
6
|
|
|
|
|
|
|
# Nigel Hamilton |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2005 |
9
|
|
|
|
|
|
|
# All Rights Reserved |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
12
|
|
|
|
|
|
|
# Filename: Goo::ProfileOption.pm |
13
|
|
|
|
|
|
|
# Description: Store individual options in the profile |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# Date Change |
16
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------- |
17
|
|
|
|
|
|
|
# 11/08/2005 Added method: test |
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
############################################################################## |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
32
|
|
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
7
|
use Goo::Object; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
24
|
1
|
|
|
1
|
|
6
|
use Goo::Prompter; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
6
|
use base qw(Goo::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
250
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
############################################################################## |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
# new - instantiate an profile_option |
32
|
|
|
|
|
|
|
# |
33
|
|
|
|
|
|
|
############################################################################## |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
1
|
1
|
2
|
my ($class, $params) = @_; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
10
|
my $this = $class->SUPER::new(); |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
960
|
$this->{text} = $params->{text}; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
5
|
return $this; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
############################################################################## |
49
|
|
|
|
|
|
|
# |
50
|
|
|
|
|
|
|
# get_text - return the text of the option |
51
|
|
|
|
|
|
|
# |
52
|
|
|
|
|
|
|
############################################################################## |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub get_text { |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
0
|
|
|
|
return $this->{text} || "Text not set for Option"; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
############################################################################## |
64
|
|
|
|
|
|
|
# |
65
|
|
|
|
|
|
|
# do - carry out the action! |
66
|
|
|
|
|
|
|
# |
67
|
|
|
|
|
|
|
############################################################################## |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub do { |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
72
|
|
|
|
|
|
|
|
73
|
0
|
0
|
|
|
|
|
unless ($this->{action}) { |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# no action |
76
|
0
|
|
|
|
|
|
Goo::Prompter::say("No action specified for this option."); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__ |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 NAME |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Goo::ProfileOption - Store individual options in the profile |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 SYNOPSIS |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
use Goo::ProfileOption; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 DESCRIPTION |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 METHODS |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=over |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item new |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
constructor |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item get_text |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
return the text of the option |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item do |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
carry out the action! |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=back |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 AUTHOR |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 SEE ALSO |