| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WWW::Giraffi::API::Media; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 6 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 41 |  | 
| 4 | 1 |  |  | 1 |  | 6 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 35 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 1 |  |  | 1 |  | 1103 | use parent qw(WWW::Giraffi::API::Request); | 
|  | 1 |  |  |  |  | 344 |  | 
|  | 1 |  |  |  |  | 5 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | our $VERSION = '0.2_04'; | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | sub all { | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 0 |  |  | 0 | 1 |  | my ( $self, $other_options ) = @_; | 
| 13 | 0 |  |  |  |  |  | return $self->search(undef, $other_options); | 
| 14 |  |  |  |  |  |  | } | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | sub search { | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 0 |  |  | 0 | 1 |  | my ( $self, $conditions, $other_options ) = @_; | 
| 19 | 0 |  |  |  |  |  | return $self->get( "media.json", $conditions, $other_options ); | 
| 20 |  |  |  |  |  |  | } | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | sub find { | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $other_options ) = @_; | 
| 25 | 0 |  |  |  |  |  | return $self->get( sprintf( "media/%s.json", $id ), undef, $other_options ); | 
| 26 |  |  |  |  |  |  | } | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | # this method has not been tested | 
| 30 |  |  |  |  |  |  | sub find_oauth { | 
| 31 |  |  |  |  |  |  |  | 
| 32 | 0 |  |  | 0 | 1 |  | my($self, $id, $other_options) = @_; | 
| 33 | 0 |  |  |  |  |  | return $self->get( sprintf( "media/%s/oauth.json", $id ), undef, $other_options ); | 
| 34 |  |  |  |  |  |  | } | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | # this method has not been tested | 
| 37 |  |  |  |  |  |  | sub find_oauth_callback { | 
| 38 |  |  |  |  |  |  |  | 
| 39 | 0 |  |  | 0 | 1 |  | my($self, $id, $oauth_verifier, $other_options) = @_; | 
| 40 | 0 |  |  |  |  |  | return $self->get( sprintf( "media/%s/oauth_callback.json", $id ), { oauth_verifier => $oauth_verifier}, $other_options ); | 
| 41 |  |  |  |  |  |  | } | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | sub create { | 
| 44 |  |  |  |  |  |  |  | 
| 45 | 0 |  |  | 0 | 1 |  | my ( $self, $conditions, $other_options ) = @_; | 
| 46 | 0 |  |  |  |  |  | return $self->post( "media.json", undef, { medium => $conditions }, $other_options ); | 
| 47 |  |  |  |  |  |  | } | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | sub update { | 
| 50 |  |  |  |  |  |  |  | 
| 51 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $conditions, $other_options ) = @_; | 
| 52 | 0 |  |  |  |  |  | return $self->put( sprintf("media/%s.json", $id), undef, { medium => $conditions }, $other_options ); | 
| 53 |  |  |  |  |  |  | } | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | sub destroy { | 
| 56 |  |  |  |  |  |  |  | 
| 57 | 0 |  |  | 0 | 1 |  | my ( $self, $id, $other_options ) = @_; | 
| 58 | 0 |  |  |  |  |  | return $self->delete( sprintf("media/%s.json", $id), undef, undef, $other_options ); | 
| 59 |  |  |  |  |  |  | } | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | 1; | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | __END__ |