NAME

JavaScript::Code::Block - a block element in javascript

SYNOPSIS

#!/usr/bin/perl

use strict;
use warnings;
use JavaScript::Code::Block;
use JavaScript::Code::Variable;

my $block = JavaScript::Code::Block->new();
my $var   = JavaScript::Code::Variable->new()->name('a')->value("Var!");

$block->add( $var );
$block->add( JavaScript::Code::Variable->new()->name('b')->value(42) );

print $block->output;

METHODS

$self->add( $element )

Adds a new element to the block

$self->elements( )

Returns a ref-array of all added elements.

$self->output( )

Returns the javascript-code block.

SEE ALSO

JavaScript::Code

AUTHOR

Sascha Kiefer, esskar@cpan.org

LICENSE

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