X-Git-Url: http://erislabs.net/gitweb/?p=liburi-template-perl.git;a=blobdiff_plain;f=README;fp=README;h=5c56f21d53ad2159dea01d78278fba9824b3d5d0;hp=c632c13503d537995163b22783686f7bd6bb5fa6;hb=c4fd5064ccd0e0c568bec68ebe82f3daf6c235b6;hpb=917525490f5d8e583f4b53dcd2d792b9e6f42c88 diff --git a/README b/README index c632c13..5c56f21 100644 --- a/README +++ b/README @@ -7,13 +7,10 @@ SYNOPSIS my $uri = $template->process( x => 'y' ); # uri is a URI object with value 'http://example.com/y' - my %result = $template->deparse( $uri ); - # %result is ( x => 'y' ) - DESCRIPTION This is an initial attempt to provide a wrapper around URI templates as described at - http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-01.txt + http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-03.txt INSTALLATION perl Makefile.PL @@ -26,34 +23,32 @@ METHODS Creates a new URI::Template instance with the template passed in as the first parameter. - as_string( ) - Returns the original template string. Also used when the object is - stringified. + template + This method returns the original template string. - variables( ) + variables Returns an array of unique variable names found in the template. NB: they are returned in random order. - all_variables( ) - Returns an array of variable names found as they appear in template -- - in order, duplicates included. + expansions + This method returns an list of expansions found in the template. + Currently, these are just coderefs. In the future, they will be more + interesting. - process( %vars|\@values ) + process( \%vars ) Given a list of key-value pairs or an array ref of values (for positional substitution), it will URI escape the values and substitute them in to the template. Returns a URI object. - process_to_string( %vars|\@values ) + process_to_string( \%vars ) Processes input like the "process" method, but doesn't inflate the result to a URI object. - deparse( $uri ) - Does some rudimentary deparsing of a uri based on the current template. - Returns a hash with the extracted values. - AUTHOR Brian Cassidy + Ricardo SIGNES + COPYRIGHT AND LICENSE Copyright 2008 by Brian Cassidy