HTML::FormFu::Deflator - Deflator Base Class


HTML-FormFu documentation Contained in the HTML-FormFu distribution.

Index


Code Index:

NAME

Top

HTML::FormFu::Deflator - Deflator Base Class

SYNOPSIS

Top

    my $deflator = $form->deflator( $type, @names );

DESCRIPTION

Top

Deflator Base Class.

METHODS

Top

names

Arguments: @names

Return Value: @names

Contains names of params to deflator.

process

Arguments: $form_result, \%params

CORE DEFLATORS

Top

HTML::FormFu::Deflator::CompoundDateTime
HTML::FormFu::Deflator::CompoundSplit
HTML::FormFu::Deflator::FormatNumber
HTML::FormFu::Deflator::PathClassFile
HTML::FormFu::Deflator::Strftime

AUTHOR

Top

Carl Franks, cfranks@cpan.org

LICENSE

Top

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


HTML-FormFu documentation Contained in the HTML-FormFu distribution.

package HTML::FormFu::Deflator;
use Moose;

with 'HTML::FormFu::Role::Populate';

use HTML::FormFu::Attribute qw( mk_inherited_accessors );
use HTML::FormFu::ObjectUtil qw( form name parent );
use Carp qw( croak );

has type => ( is => 'rw', traits  => ['Chained'] );

__PACKAGE__->mk_inherited_accessors(qw( locale ));

sub BUILD {}
sub process {
    my ( $self, $values ) = @_;

    if ( ref $values eq 'ARRAY' ) {
        return [ map { $self->deflator($_) } @$values ];
    }
    else {
        return $self->deflator($values);
    }
}

sub clone {
    my ($self) = @_;

    my %new = %$self;

    return bless \%new, ref $self;
}

__PACKAGE__->meta->make_immutable;

1;

__END__