File: Response.pm

package info (click to toggle)
libpod-webserver-perl 3.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 160 kB
  • sloc: perl: 440; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 965 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package Pod::Webserver::Response;

use strict;
use warnings;

our $VERSION = '3.11';

# ------------------------------------------------
# The real methods are setter/getters. We only need the setters.

sub AUTOLOAD {
  my ($attrib) = $Pod::Webserver::Response::AUTOLOAD =~ /([^:]+)$/;
  $_[0]->{$attrib} = $_[1];

} # End of AUTOLOAD.

# ------------------------------------------------
# The real method is a setter/getter. We only need the getter.

sub content_ref {
  my $self = shift;
  return \$self->{content};

} # End of content_ref.

# ------------------------------------------------

sub DESTROY {};

# ------------------------------------------------

sub header {
  my $self = shift;
  push @{$self->{header}}, @_;

} # End of header.

# ------------------------------------------------

sub new {
  my ($class, $status_code) = @_;

  return bless {code=>$status_code}, $class;

} # End of new.

# ------------------------------------------------

1;