File Coverage

blib/lib/XML/SRS/DS.pm
Criterion Covered Total %
statement 2 4 50.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 4 6 66.6


line stmt bran cond sub pod time code
1             package XML::SRS::DS;
2             BEGIN {
3 1     1   8338 $XML::SRS::DS::VERSION = '0.09';
4             }
5              
6 1     1   544 use Moose;
  0            
  0            
7             use PRANG::Graph;
8             use XML::SRS::Types;
9              
10             has_attr 'key_tag' =>
11             is => "ro",
12             isa => "Int",
13             xml_name => "KeyTag",
14             ;
15              
16             has_attr 'algorithm' =>
17             is => "ro",
18             isa => "Int",
19             xml_name => "Algorithm",
20             ;
21              
22             has_attr 'digest_type' =>
23             is => "ro",
24             isa => "Int",
25             xml_name => "DigestType",
26             ;
27            
28             has_element 'digest' =>
29             is => "rw",
30             isa => "Str",
31             xml_nodeName => "Digest",
32             ;
33              
34             with 'XML::SRS::Node';
35              
36             # Compare against another DS object, and
37             # return true if we decide it's equal
38             sub is_equal {
39             my $self = shift;
40             my $other = shift;
41            
42             confess "Can only compare against another XML::SRS::DS"
43             unless blessed $other && $other->isa('XML::SRS::DS');
44            
45             return 1 if $self->key_tag eq $other->key_tag &&
46             $self->algorithm eq $other->algorithm &&
47             $self->digest_type eq $other->digest_type &&
48             $self->digest eq $other->digest;
49            
50             return 0;
51             }
52              
53             1;