[411ba2]: / extras / whip / Whip / Attribute.pm  Maximize  Restore  History

Download this file

32 lines (23 with data), 494 Bytes

 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
# $Id$
# Whip::Attribute is a name/value pair. It could be a hash, but we
# store them in lists because there are potentially duplicates.
package Whip::Attribute;
use warnings;
use strict;
sub ATT_NAME () { 0 }
sub ATT_VAL () { 1 }
sub new {
my $package = shift;
my ($name, $value) = @_;
my $self = bless { $name, $value }, $package;
return $self;
}
sub name {
my $self = shift;
return (keys %$self)[0];
}
sub value {
my $self = shift;
return (values %$self)[0];
}
1;