version 1.2, 2010/01/24 04:17:39 |
version 1.4, 2010/01/26 06:03:11 |
|
|
package Text::Todo::REST::API::Response; |
package Text::Todo::REST::API::Response; |
|
|
# $AFresh1: Response.pm,v 1.1 2010/01/23 07:04:43 andrew Exp $ |
# $AFresh1: Response.pm,v 1.3 2010/01/26 05:05:34 andrew Exp $ |
|
|
use warnings; |
use warnings; |
use strict; |
use strict; |
|
|
my $ident = ident($self); |
my $ident = ident($self); |
|
|
$format_of{$ident} = $options->{format} || ''; |
$format_of{$ident} = $options->{format} || ''; |
$data_of{$ident} = $options->{data}; |
$data_of{$ident} = $options->{data}; |
|
|
if ( $options->{type} ) { |
if ( $options->{type} ) { |
$type_of{$ident} = $options->{type}; |
$type_of{$ident} = $options->{type}; |
|
|
return $self; |
return $self; |
} |
} |
|
|
#sub content_type { |
sub content_type { |
#my ($self) = shift; |
my ($self) = shift; |
#my $ident = ident($self); |
return $self->_handle_representation('content_type'); |
#return defined $content_type_of{$ident} |
} |
#} |
|
|
|
sub _handle_representation { |
sub _handle_representation { |
my ( $self, $method, $options ) = @_; |
my ( $self, $method, $options ) = @_; |
|
|
$method = join q{_}, $method, $self->type; |
if ( $method ne 'content_type' ) { |
|
$method = join q{_}, $method, $self->type; |
|
} |
|
|
my $format = $self->format; |
my $format = $self->format; |
if ( $options->{format} ) { |
if ( $options->{format} ) { |