|
Revision 27257, 1.1 kB
(checked in by lopnor, 4 years ago)
|
|
fix typo in the pod
|
| Line | |
|---|
| 1 | package Net::Google::Spreadsheets::Spreadsheet; |
|---|
| 2 | use Moose; |
|---|
| 3 | use XML::Atom; |
|---|
| 4 | use Net::Google::Spreadsheets::Worksheet; |
|---|
| 5 | use Path::Class; |
|---|
| 6 | |
|---|
| 7 | extends 'Net::Google::Spreadsheets::Base'; |
|---|
| 8 | |
|---|
| 9 | has +title => ( |
|---|
| 10 | is => 'ro', |
|---|
| 11 | ); |
|---|
| 12 | |
|---|
| 13 | has key => ( |
|---|
| 14 | isa => 'Str', |
|---|
| 15 | is => 'ro', |
|---|
| 16 | required => 1, |
|---|
| 17 | lazy => 1, |
|---|
| 18 | default => sub { |
|---|
| 19 | my $self = shift; |
|---|
| 20 | my $key = file(URI->new($self->id)->path)->basename; |
|---|
| 21 | return $key; |
|---|
| 22 | } |
|---|
| 23 | ); |
|---|
| 24 | |
|---|
| 25 | after _update_atom => sub { |
|---|
| 26 | my ($self) = @_; |
|---|
| 27 | $self->{content} = $self->atom->content->elem->getAttribute('src'); |
|---|
| 28 | }; |
|---|
| 29 | |
|---|
| 30 | sub worksheets { |
|---|
| 31 | my ($self, $cond) = @_; |
|---|
| 32 | return $self->list_contents('Net::Google::Spreadsheets::Worksheet', $cond); |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | sub add_worksheet { |
|---|
| 36 | my ($self, $args) = @_; |
|---|
| 37 | my $entry = Net::Google::Spreadsheets::Worksheet->new->entry; |
|---|
| 38 | my $atom = $self->service->post($self->content, $entry); |
|---|
| 39 | $self->sync; |
|---|
| 40 | return Net::Google::Spreadsheets::Worksheet->new( |
|---|
| 41 | container => $self, |
|---|
| 42 | atom => $atom, |
|---|
| 43 | ); |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | 1; |
|---|
| 47 | __END__ |
|---|
| 48 | |
|---|
| 49 | =head1 NAME |
|---|
| 50 | |
|---|
| 51 | Net::Google::Spreadsheets::Spreadsheet - Representation of spreadsheet |
|---|
| 52 | |
|---|
| 53 | =head1 SYNOPSIS |
|---|
| 54 | |
|---|
| 55 | =head1 AUTHOR |
|---|
| 56 | |
|---|
| 57 | Nobuo Danjou E<lt>nobuo.danjou@gmail.comE<gt> |
|---|
| 58 | |
|---|
| 59 | =cut |
|---|