Skip to content

Commit

Permalink
added hashref support to query
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 17, 2009
1 parent 186966a commit 2690804
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Mojo/URL.pm
Expand Up @@ -129,7 +129,8 @@ sub query {

# Set
if (@_) {
$self->{query} = @_ > 1 ? Mojo::Parameters->new(@_) : $_[0];
$self->{query} =
@_ > 1 ? Mojo::Parameters->new(ref $_[0] ? @{$_[0]} : @_) : $_[0];
return $self;
}

Expand Down Expand Up @@ -373,6 +374,7 @@ following new ones.
my $query = $url->query;
$url = $url->query(name => 'value');
$url = $url->query([name => 'value']);
$url = $url->query(Mojo::Parameters->new);
=head2 C<to_abs>
Expand Down

0 comments on commit 2690804

Please sign in to comment.