X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=README;h=f621fca5d2dc1763794703231ba9d1ab1bfbf956;hb=refs%2Ftags%2Fupstream%2F0.15;hp=59f5a76c9e88cc99dea724e21550285bbfd21ff0;hpb=53a1b94e04453d9c7eea079af549f2179320b952;p=liburi-template-perl.git diff --git a/README b/README index 59f5a76..f621fca 100644 --- a/README +++ b/README @@ -7,64 +7,50 @@ 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-00.txt + http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-03.txt INSTALLATION - To install this module via Module::Build: - - perl Build.PL - ./Build # or `perl Build` - ./Build test # or `perl Build test` - ./Build install # or `perl Build install` - - To install this module via ExtUtils::MakeMaker: - - perl Makefile.PL - make - make test - make install + perl Makefile.PL + make + make test + make install METHODS new( $template ) 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( ) - Returns an array of variable names found in the template. NB: they are - returned in random order. + 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 + Brian Cassidy + + Ricardo SIGNES COPYRIGHT AND LICENSE - Copyright 2007 by Brian Cassidy + Copyright 2007-2009 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.