Apache2-HTML-Detergent

 view release on metacpan or  search on metacpan

lib/Apache2/HTML/Detergent/Config.pm  view on Meta::CPAN

}

*SERVER_CREATE = \&DIR_CREATE;
*SERVER_MERGE  = \&DIR_MERGE;

# Moose stuff

=head1 METHODS

Aside from those accessors inherited from L<HTML::Detergent::Config>,
there are the following methods:

=head2 types

MIME types affected by the module.

=cut

has types => (
    is      => 'rw',
    isa     => HashRef,
    lazy    => 1,
    default => sub { { 'text/html' => 1, 'application/xhtml+xml' => 1 } },
);

=head2 xslt

A path to an XSLT stylesheet.

=cut

has xslt => (
    is      => 'rw',
    isa     => Maybe[Str],
    lazy    => 1,
    default => sub { undef },
);

=head2 set_type

=cut

# apache stuff

sub set_type {
    my ($self, $type) = @_;
    $type =~ s!^\s*([^/]+/[^/;]+).*!\L$1!;
    $self->types->{$type} = 1;
}

=head2 type_matches

=cut

sub type_matches {
    my ($self, $type) = @_;
    return unless defined $type;
    $type =~ s!^\s*([^/]+/[^/;]+).*!\L$1!;
    # ok so i'm not on crack
    #warn $type;
    #require Data::Dumper;
    #warn Data::Dumper::Dumper($self->types);
    return $self->types->{$type};
}

=head2 COPYRIGHT & LICENSE

=cut

__PACKAGE__->meta->make_immutable;

1; # End of Apache2::HTML::Detergent::Config



( run in 1.334 second using v1.01-cache-2.11-cpan-39bf76dae61 )