Dave Rolsky > Courriel-0.30 > Courriel::HeaderAttribute

Download:
Courriel-0.30.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
Stalled  1
View/Report Bugs
Module Version: 0.30   Source   Latest Release: Courriel-0.31

NAME ^

Courriel::HeaderAttribute - A single attribute belonging to a header

VERSION ^

version 0.30

SYNOPSIS ^

  my $ct = $headers->get('Content-Type');
  print $ct->get_attribute('charset')->value();

DESCRIPTION ^

This class represents a single attribute belonging to a header. An attribute consists of a name and value, with optional charset and language information.

API ^

This class supports the following methods:

Courriel::HeaderAttribute->new( ... ) ^

This method creates a new object. It accepts the following parameters:

$attribute->name()

The attribute name as passed to the constructor.

$attribute->value()

The attribute value as passed to the constructor.

$attribute->charset()

The attribute's charset.

$attribute->language()

The attribute's language.

$attribute->as_string()

This returns the attribute in a form suitable for putting in an email. This may involve escaping, quoting, splitting up, and otherwise messing with the value.

If the value needs to be split across continuations, each name/value pair is returned separate by a space, but not folded across multiple lines.

$attribute->stream_to( output => $output )

This method will send the stringified attribute to the specified output. The output can be a subroutine reference, a filehandle, or an object with a print() method. The output may be sent as a single string, as a list of strings, or via multiple calls to the output.

ROLES ^

This class does the Courriel::Role::Streams role.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2012 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: