kasei / perl-iri

Perl implementation of Internationalized Resource Identifiers (IRIs)
0 stars 6 forks source link

Add query form read/write methods #4

Closed kasei closed 8 years ago

kasei commented 9 years ago

Add methods similar to URI->query_form that allow accessing and setting query form parameters on an IRI. For the setter methods, consider returning new IRI objects instead of mutating the existing object:

my $iri = IRI->new('http://example.org/?name=test');
say $iri->query_form('name'); # test
my $iri2 = $iri->query_form('name' => 'hello');
say $iri2->as_string; # http://example.org/?name=hello
kasei commented 8 years ago

Decided to implement only a query form accessor and a constructor method to create a new IRI instance (leaving each IRI instance immutable).