NAME
Net::Google::Spreadsheets::Table - A representation class for Google Spreadsheet table.
SYNOPSIS
use Net::Google::Spreadsheets;
my $service = Net::Google::Spreadsheets->new(
username => 'mygoogleaccount@example.com',
password => 'mypassword',
);
# get a table
my $table = $service->spreadsheet(
{
title => 'list for new year cards',
}
)->table(
{
title => 'sample table',
}
);
# create a record
my $r = $table->add_record(
{
name => 'Nobuo Danjou',
nick => 'lopnor',
mail => 'nobuo.danjou@gmail.com',
age => '33',
}
);
# get records
my @records = $table->records;
# search records
@records = $table->records({sq => 'age > 20'});
# search a record
my $record = $table->record({sq => 'name = "Nobuo Danjou"'});
METHODS
records(\%condition)
Returns a list of Net::Google::Spreadsheets::Record objects. Acceptable arguments are:
- sq
-
Structured query on the full text in the worksheet. see the URL below for detail.
- orderby
-
Set column name to use for ordering.
- reverse
-
Set 'true' or 'false'. The default is 'false'.
See http://code.google.com/intl/en/apis/spreadsheets/docs/3.0/reference.html#RecordParameters for details.
record(\%condition)
Returns first item of records(\%condition) if available.
add_record(\%contents)
Creates new record and returns a Net::Google::Spreadsheets::Record object representing it. Arguments are contents of a row as a hashref.
my $record = $table->add_record(
{
name => 'Nobuo Danjou',
nick => 'lopnor',
mail => 'nobuo.danjou@gmail.com',
age => '33',
}
);
SEE ALSO
http://code.google.com/intl/en/apis/spreadsheets/docs/3.0/developers_guide_protocol.html
http://code.google.com/intl/en/apis/spreadsheets/docs/3.0/reference.html
Net::Google::Spreadsheets::Spreadsheet
Net::Google::Spreadsheets::Record
AUTHOR
Nobuo Danjou <nobuo.danjou@gmail.com>