NAME

Metabrik::Example::Template - example::template Brik

SYNOPSIS

# Prepare a skeleton in order to create a new Brik

$ cp lib/Metabrik/Example/Template.pm ~/myMetabriky/lib/Category/Mybrik.pm
$ vi ~/myMetabrik/lib/Category/Mybrik.pm

# Use a Brik from a Perl module

use Metabrik::Example::Template;

my $value1 = 'value1';

my $brik = Metabrik::Example::Template->new;
$brik->brik_init;
$brik->attribute1($value);
$brik->attribute2(1);

my $result = $brik->command1($argument1, $argument2);

# Use a Brik from a the Metabrik Shell

> my $value1 = 'value1'
> set example::template attribute1 $value1
> set example::template attribute2 1
> run example::template command1 argument1 argument2
> $RUN  # Will contain the result

# Use a Brik from the Metabrik Shell (Perl multiline code)

> for my $this (1..3) { \
..    $CON->run('example::template', 'command1', 'argument1', $this); \
.. }

# Another option
> for my $this (1..3) { \
..    $SHE->cmd('run example::template command1 argument1 $this'); \
.. }

# Use a Brik from a Metabrik Brik

my $context = $self->context;

my $value1 = 'value1';

$context->use('example::template');
$context->set('example::template', 'attribute1', $value1);
$context->set('example::template', 'attribute2', 1);

my $result = $context->run('example::template', 'command1', 'argument1', 'argument2');

DESCRIPTION

Template to write a new Metabrik Brik.

COPYRIGHT AND LICENSE

Copyright (c) 2014-2015, Patrice <GomoR> Auffret

You may distribute this module under the terms of The BSD 3-Clause License. See LICENSE file in the source distribution archive.

AUTHOR

Patrice <GomoR> Auffret