Google::Chart::QueryComponent::Simple - Simplified Google::Chart Query Component


Google-Chart documentation Contained in the Google-Chart distribution.

Index


Code Index:

NAME

Top

Google::Chart::QueryComponent::Simple - Simplified Google::Chart Query Component

SYNOPSIS

Top

  package MyStuff;
  use Moose;
  with 'Google::Chart::QueryComponent::Simple';

METHODS

Top

as_query


Google-Chart documentation Contained in the Google-Chart distribution.

# $Id$

package Google::Chart::QueryComponent::Simple;
use Moose::Role;
use URI::Escape ();

with 'Google::Chart::QueryComponent';

requires qw(parameter_name parameter_value);

no Moose;

sub as_query {
    my $self = shift;

    return wantarray ? 
        ($self->parameter_name, $self->parameter_value) :
        join('=', $self->parameter_name, URI::Escape::uri_escape($self->parameter_value))
    ;
};

1;

__END__