NAME

Inline::Mason::OO - Inline OO Mason

SYNOPSIS

My perl script:

package MY::Mason;
use Inline::Mason::OO;
our @ISA = qw(Inline::Mason::OO);

package main;

my $m = new MY::Mason ('t/external_mason');
print $m->HELLO();
print $m->NIFTY(lang => 'Perl');



__END__

__HELLO__
% my $noun = 'World';
Hello <% $noun %>!
How are ya?

t/external_mason

__NIFTY__
<% $ARGS{lang} %> is nifty!

DESCRIPTION

This module extends the power of Inline::Mason to an OO level. You may use it to build a module specific for generating documents, like help documentation, etc.

METHODS

new

The constructor takes a list of file's names in which mason scripts reside and will load them to the instance. The file where the constructor is called is always loaded by default.

load_mason

Create mason scripts in place, and you can pass a list of pairs.

Load mason script in place:

my $m = new MY::Mason;
$m->load_mason
(
 BEATLES
 =>
 'Nothing\'s gonna change my <% $ARGS{what} %>',
 # ... ... ...
 );

print $m->BEATLES(what => 'world');

load_file

Load an external file manually and explicitly.

my $m = new MY::Mason;
$m->load_file('external_mason.txt');

SEE ALSO

Inline::Mason

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Yung-chung Lin (a.k.a. xern) <xern@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself