[BACK]Return to Response.pm CVS log [TXT][DIR] Up to [local] / todotxt / Text-Todo-REST-API / lib / Text / Todo / REST / API

Diff for /todotxt/Text-Todo-REST-API/lib/Text/Todo/REST/API/Response.pm between version 1.1 and 1.3

version 1.1, 2010/01/23 07:04:43 version 1.3, 2010/01/26 05:05:34
Line 1 
Line 1 
 package Text::Todo::REST::API::Response;  package Text::Todo::REST::API::Response;
   
 # $AFresh1$  # $AFresh1: Response.pm,v 1.2 2010/01/24 04:17:39 andrew Exp $
   
 use warnings;  use warnings;
 use strict;  use strict;
Line 42 
Line 42 
         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} ) {
             $format = $options->{format};              $format = $options->{format};
         }          }
Line 62 
Line 63 
             if (   $class->can_render($format)              if (   $class->can_render($format)
                 && $class->can($method) )                  && $class->can($method) )
             {              {
                 return $class->$method( $format, $self->_data );                  return $class->$method( $format, $self->data );
             }              }
         }          }
   
Line 83 
Line 84 
         croak(@message);          croak(@message);
     }      }
   
     sub _format { my ($self) = @_; return $format_of{ ident $self}; }      sub format { my ($self) = @_; return $format_of{ ident $self}; }
     sub _type   { my ($self) = @_; return $type_of{ ident $self}; }      sub type   { my ($self) = @_; return $type_of{ ident $self}; }
     sub _data   { my ($self) = @_; return $data_of{ ident $self}; }      sub data   { my ($self) = @_; return $data_of{ ident $self}; }
   
     sub DESTROY {      sub DESTROY {
         my ($self) = @_;          my ($self) = @_;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>