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       See Spoon::Trace::trace().
21
22   conf(name, default)
23       Returns the configuration value for "name", if it can be found in the
24       config ($self->hub->config).  Returns $default, otherwise.
25

METHODS

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

TODO

99       * Document what Spoon::Base->debug() does.
100

AUTHOR

102       Brian Ingerson <INGY@cpan.org>
103
105       Copyright (c) 2004. Brian Ingerson. All rights reserved.
106
107       This program is free software; you can redistribute it and/or modify it
108       under the same terms as Perl itself.
109
110       See http://www.perl.com/perl/misc/Artistic.html
111
112
113
114perl v5.32.0                      2020-07-28                    Spoon::Base(3)
Impressum