Imported Upstream version 0.14.01
[liburi-template-perl.git] / README
1 NAME
2     URI::Template - Object for handling URI templates
3
4 SYNOPSIS
5         use URI::Template;
6         my $template = URI::Template->new( 'http://example.com/{x}' );
7         my $uri      = $template->process( x => 'y' );
8         # uri is a URI object with value 'http://example.com/y'
9
10 DESCRIPTION
11     This is an initial attempt to provide a wrapper around URI templates as
12     described at
13     http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-03.txt
14
15 INSTALLATION
16         perl Makefile.PL
17         make
18         make test
19         make install
20
21 METHODS
22   new( $template )
23     Creates a new URI::Template instance with the template passed in as the
24     first parameter.
25
26   template
27     This method returns the original template string.
28
29   variables
30     Returns an array of unique variable names found in the template. NB:
31     they are returned in random order.
32
33   expansions
34     This method returns an list of expansions found in the template.
35     Currently, these are just coderefs. In the future, they will be more
36     interesting.
37
38   process( \%vars )
39     Given a list of key-value pairs or an array ref of values (for
40     positional substitution), it will URI escape the values and substitute
41     them in to the template. Returns a URI object.
42
43   process_to_string( \%vars )
44     Processes input like the "process" method, but doesn't inflate the
45     result to a URI object.
46
47 AUTHOR
48     Brian Cassidy <bricas@cpan.org>
49
50     Ricardo SIGNES <rjbs@cpan.org>
51
52 COPYRIGHT AND LICENSE
53     Copyright 2008 by Brian Cassidy
54
55     This library is free software; you can redistribute it and/or modify it
56     under the same terms as Perl itself.
57