File: Entry.pm

package info (click to toggle)
libnet-irc-perl 0.75-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 264 kB
  • ctags: 165
  • sloc: perl: 2,290; makefile: 38
file content (40 lines) | stat: -rw-r--r-- 1,736 bytes parent folder | download | duplicates (7)
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
package Net::IRC::EventQueue::Entry;
                                                                                                                                     
use strict;
                                                                                                                                     
my $id = 0;
                                                                                                                                     
sub new {
  my $class = shift;
  my $time = shift;
  my $content = shift;
                                                                                                                                     
  my $self = {
    'time'  => $time,
    'content' => $content,
    'id'    => "$time:" . $id++,
  };
                                                                                                                                     
  bless $self, $class;
  return $self;
}
                                                                                                                                     
sub id {
  my $self = shift;
  return $self->{'id'};
}
                                                                                                                                     
sub time {
  my $self = shift;
  $self->{'time'} = $_[0] if @_;
  return $self->{'time'};
}
                                                                                                                                     
sub content {
  my $self = shift;
  $self->{'content'} = $_[0] if @_;
  return $self->{'content'};
}
                                                                                                                                     
1;