1Spoon::Base(3)        User Contributed Perl Documentation       Spoon::Base(3)
2
3
4

NAME

6       Spoon::Base - Generic Spoon Base Class
7

SYNOPSIS

9           use Spoon::Base '-Base';
10

DESCRIPTION

12       Base class for application plugins.  Provides basic functionality to
13       all modules inheriting from this class.
14

SUBROUTINES

16       These subroutines are meant to be called bare, not as an object-method
17       call.
18
19       trace
20
21       See Spoon::Trace::trace().
22
23       conf(name, default)
24
25       Returns the configuration value for "name", if it can be found in the
26       config ($self->hub->config).  Returns $default, otherwise.
27

METHODS

29       hub
30
31       Return the application's hub object.  See Spoon::Hub.
32
33       init
34
35       Inherited by all subclasses.  Put your class initialization stuff here.
36
37       assert(boolean)
38
39       Die if the supplied argument is false.
40
41       t([label])
42
43       Calls Spoon::Trace::mark().  See Spoon::Trace.
44
45       clone
46
47       Copies a class instance.  The copy is only a shallow one.
48
49       is_in_cgi
50
51       Returns a boolean, indicating whether we were called from a CGI inter‐
52       face.
53
54       is_in_test
55
56       Returns a boolean, indicating whether we were called from a test suite.
57
58       have_plugin(class_id)
59
60       Tries to load a plugin.  See Spoon::Hub::load_class().
61
62       plugin_directory
63
64       Returns your plugin's directory.  You can use this directory to store
65       state.
66
67       env_check(variable_name)
68
69       Sanity check: ensure the specified variable exists in %ENV.  If the
70       variable is not found, dies with a useful error message.
71
72       dumper_to_file(filepath, variable1 [, variable2...])
73
74       Uses Data::Dumper to save a dump of one or more variables to the speci‐
75       fied file.
76
77       has_utf8
78
79       Returns a boolean, indicating whether utf8 is available on this plat‐
80       form and version of perl.
81
82       utf8_encode(string)
83
84       Encodes the string in utf8, if utf8 is available.  Otherwise, returns
85       $string unmodified.  See Encode::encode().
86
87       utf8_decode(string)
88
89       Decodes the string from utf8, if utf8 is available.  Otherwise, returns
90       $string unmodified.  See Encode::decode().
91
92       uri_escape(string)
93
94       Escapes all invalid URI characters.  See CGI::Util::escape().
95
96       uri_unescape(string)
97
98       Unescapes all invalid URI characters.  See CGI::Util::unescape().
99
100       html_escape(string)
101
102       Escapes all reserved characters.  The result is suitable for including
103       verbatim in an HTML document.  See CGI::escapeHTML().
104
105       html_unescape(string)
106
107       Escapes all reserved characters.  The result is suitable for including
108       verbatim in an HTML document.  See CGI::unescapeHTML().
109
110       base64_encode(string)
111
112       Encodes the specified string into Base64.  See
113       MIME::Base64::encode_base64().
114
115       base64_encode(base64_data)
116
117       Decodes the specified data from Base64.  See
118       MIME::Base64::decode_base64().
119

TODO

121       * Document what Spoon::Base->debug() does.
122

AUTHOR

124       Brian Ingerson <INGY@cpan.org>
125
127       Copyright (c) 2004. Brian Ingerson. All rights reserved.
128
129       This program is free software; you can redistribute it and/or modify it
130       under the same terms as Perl itself.
131
132       See http://www.perl.com/perl/misc/Artistic.html
133
134
135
136perl v5.8.8                       2006-08-26                    Spoon::Base(3)
Impressum