[Bps-public-commit] r11197 - WebChart/lib/WebChart
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Wed Mar 26 10:34:21 EDT 2008
Author: sunnavy
Date: Wed Mar 26 10:34:21 2008
New Revision: 11197
Added:
WebChart/lib/WebChart/Renderer.pm
Log:
added Renderer.pm
Added: WebChart/lib/WebChart/Renderer.pm
==============================================================================
--- (empty file)
+++ WebChart/lib/WebChart/Renderer.pm Wed Mar 26 10:34:21 2008
@@ -0,0 +1,53 @@
+package WebChart::Renderer;
+use strict;
+use warnings;
+use Carp;
+
+=head2 new
+
+don't subclass this, subclass C<init> instead.
+
+=cut
+
+sub new {
+ my $class = shift;
+ my $self = bless {}, $class;
+ $self->init(@_);
+ return $self;
+}
+
+=head2 init
+
+init job is done here, you don't need to call this directly, C<new> will.
+you should subclass this method instead of C<new>.
+
+=cut
+
+sub init { }
+
+=head2 render
+
+you should subclass this
+
+=cut
+
+sub render {
+ my $self = shift;
+ my %args = ( width => 400, height => 300, @_ );
+ for (qw/type data/) {
+ croak "need $_ arg" unless $args{type};
+ }
+}
+
+1;
+
+=head1 AUTHOR
+
+sunnavy C<< <sunnavy at bestpractical.com> >>
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright 2008 Best Practical Solutions.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
More information about the Bps-public-commit
mailing list