| 1 | package Net::OpenSocial::Client::Protocol; | ||
| 2 | |||
| 3 | 1 | ▶ | use Any::Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | use LWP::UserAgent; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | has 'formatter' => ( | |
| 8 | is => 'ro', | ||
| 9 | required => 1, | ||
| 10 | does => 'Net::OpenSocial::Client::Formatter', | ||
| 11 | ); | ||
| 12 | |||
| 13 | 1 | has 'request_builder' => ( | |
| 14 | is => 'ro', | ||
| 15 | required => 1, | ||
| 16 | does => 'Net::OpenSocial::Client::HTTPRequestBuilder', | ||
| 17 | ); | ||
| 18 | |||
| 19 | has 'agent' => ( | ||
| 20 | is => 'ro', | ||
| 21 | required => 1, | ||
| 22 | 0 | ▶ | default => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 23 | 0 | LWP::UserAgent->new; | |
| 24 | }, | ||
| 25 | 1 | ); | |
| 26 | |||
| 27 | 0 | ▶ | sub execute { |
|
Subroutine
execute: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 28 | 0 | my ( $self, $container, $requests ) = @_; | |
| 29 | 0 | die "abstract method"; | |
| 30 | } | ||
| 31 | |||
| 32 | 1 | ▶ | no Any::Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 33 | 1 | __PACKAGE__->meta->make_immutable; | |
| 34 | 1 | 1; | |
| 35 | |||
| 36 | =head1 NAME | ||
| 37 | |||
| 38 | Net::OpenSocial::Client::Protocol - Protocol base class | ||
| 39 | |||
| 40 | =head1 SYNOPSIS | ||
| 41 | |||
| 42 | package ConcreteProtocol; | ||
| 43 | use Any::Moose; | ||
| 44 | exnteds 'Net::OpenSocial::Client::Protocol'; | ||
| 45 | |||
| 46 | override 'execute' => sub { | ||
| 47 | ... | ||
| 48 | }; | ||
| 49 | |||
| 50 | =head1 DESCRIPTION | ||
| 51 | |||
| 52 | Protocol base class. | ||
| 53 | |||
| 54 | =head1 METHODS | ||
| 55 | |||
| 56 | =head2 formatter | ||
| 57 | |||
| 58 | Formatter concrete class object. | ||
| 59 | See L<Net::OpenSocial::Client::Formatter> | ||
| 60 | |||
| 61 | =head2 request_builder | ||
| 62 | |||
| 63 | HTTPRequestBuilder concrete class object. | ||
| 64 | See L<Net::OpenSocial::Client::Protocol::HTTPRequestBuilder> | ||
| 65 | |||
| 66 | =head2 agent | ||
| 67 | |||
| 68 | HTTP Agent class object. | ||
| 69 | Set LWP::UserAgent object by default. | ||
| 70 | |||
| 71 | =head2 execute($container, $requests) | ||
| 72 | |||
| 73 | Execute a protocol, and returns a L<Net::OpenSocial::Client::ResultSet> object | ||
| 74 | or nothing | ||
| 75 | |||
| 76 | my $result_set = $protocol->execute($container, $requests) | ||
| 77 | or die $protocol->errstr; | ||
| 78 | |||
| 79 | =head1 SEE ALSO | ||
| 80 | |||
| 81 | L<Net::OpenSocial::Client::Protocol::REST> | ||
| 82 | L<Net::OpenSocial::Client::Protocol::RPC> | ||
| 83 | L<Net::OpenSocial::Client::Protocol::Builder> | ||
| 84 | |||
| 85 | =head1 AUTHOR | ||
| 86 | |||
| 87 | Lyo Kato, E<lt>lyo.kato@gmail.comE<gt> | ||
| 88 | |||
| 89 | =head1 COPYRIGHT AND LICENSE | ||
| 90 | |||
| 91 | Copyright (C) 2009 by Lyo Kato | ||
| 92 | |||
| 93 | This library is free software; you can redistribute it and/or modify | ||
| 94 | it under the same terms as Perl itself, either Perl version 5.8.8 or, | ||
| 95 | at your option, any later version of Perl 5 you may have available. | ||
| 96 | |||
| 97 | =cut | ||