
package Text::Wigwam::Stash::Base::Magic::Expr;

use strict;
use warnings;
no warnings 'uninitialized';

our $VERSION = '0.01';

use base 'Text::Wigwam::Stash::Base::Magic';

sub Refclass { 'EXPR' }
sub Refname  { 'EXPR' }
sub Html     {$_[1]->beautify(Text::Wigwam::Beautify::Html->new())}
sub Text     {$_[1]->beautify(Text::Wigwam::Beautify::Text->new())}
sub Size     { $_[1]->size }
sub Doc      { $_[1]->doc }
sub Engine   { $_[1]->engine }
sub Render   { $_[1]->render } # Temporary
sub Virtual  { Text::Wigwam::Virtual->new( $_[1] ) }
sub Info      {
    my ($self, $expr) = @_;
    join( "" =>
        $expr->engine,
        " ",
        $expr->isa(q/Text::Wigwam/)
            ? "template object"
            : "expression object",
        " from ", ref($expr), " ",
        $expr->doc,
        " has ",
        $expr->size,
        " tokens",        
    );
}

1;
