File Coverage

blib/lib/WWW/WolframAlpha/Didyoumeans.pm
Criterion Covered Total %
statement 12 31 38.7
branch 0 6 0.0
condition 0 4 0.0
subroutine 4 7 57.1
pod 0 3 0.0
total 16 51 31.3


line stmt bran cond sub pod time code
1             package WWW::WolframAlpha::Didyoumeans;
2              
3 1     1   18 use 5.008008;
  1         2  
  1         39  
4 1     1   5 use strict;
  1         2  
  1         35  
5 1     1   6 use warnings;
  1         1  
  1         43  
6              
7             require Exporter;
8              
9 1     1   524 use WWW::WolframAlpha::Didyoumean;
  1         2  
  1         321  
10              
11             our @ISA = qw(Exporter);
12              
13             # Items to export into callers namespace by default. Note: do not export
14             # names by default without a very good reason. Use EXPORT_OK instead.
15             # Do not simply export all your public functions/methods/constants.
16              
17             # This allows declaration use WWW::WolframAlpha ':all';
18             # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
19             # will save memory.
20             our %EXPORT_TAGS = ( 'all' => [ qw(
21             ) ] );
22              
23             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
24              
25             our @EXPORT = qw(
26             );
27              
28             our $VERSION = '1.0';
29              
30             sub new {
31 0     0 0   my $class = shift;
32 0           my $xmlo = shift;
33              
34 0           my $self = {};
35              
36 0           $self->{'count'} = 0;
37 0           @{$self->{'didyoumean'}} = ();
  0            
38              
39 0           my ($count,$didyoumean);
40              
41 0 0         if ($xmlo) {
42 0   0       $count = $xmlo->{'count'} || undef;
43 0   0       $didyoumean = $xmlo->{'didyoumean'} || undef;
44              
45 0 0         $self->{'count'} = $count if defined $count;
46              
47 0 0         if (defined $didyoumean) {
48 0           foreach my $value (@{$didyoumean}) {
  0            
49 0           push(@{$self->{'didyoumean'}}, WWW::WolframAlpha::Didyoumean->new($value));
  0            
50             }
51             }
52             }
53              
54              
55 0           return(bless($self, $class));
56             }
57              
58 0     0 0   sub count {shift->{'count'};}
59 0     0 0   sub didyoumean {shift->{'didyoumean'};}
60              
61              
62             # Preloaded methods go here.
63              
64             1;
65              
66              
67             =pod
68              
69             =head1 NAME
70              
71             WWW::WolframAlpha::Didyoumeans
72              
73             =head1 VERSION
74              
75             version 1.10
76              
77             =head1 SYNOPSIS
78              
79             if ($query->didyoumeans->count) {
80             foreach my $didyoumean (@{$query->didyoumeans->didyoumean}) {
81             ...
82             }
83             }
84              
85             =head1 DESCRIPTION
86              
87             =head2 ATTRIBUTES
88              
89             $didyoumeans->count
90              
91             =head2 SECTOINS
92              
93             $didyoumeans->didyoumean - array of L objects
94              
95             =head2 EXPORT
96              
97             None by default.
98              
99             =head1 NAME
100              
101             WWW::WolframAlpha::Didyoumeans - Perl objects returned via $query->didyoumeans
102              
103             =head1 SEE ALSO
104              
105             L
106              
107             =head1 AUTHOR
108              
109             Gabriel Weinberg, Eyegg@alum.mit.eduE
110              
111             =head1 COPYRIGHT AND LICENSE
112              
113             Copyright (C) 2009 by Gabriel Weinberg
114              
115             This library is free software; you can redistribute it and/or modify
116             it under the same terms as Perl itself, either Perl version 5.8.8 or,
117             at your option, any later version of Perl 5 you may have available.
118              
119             =head1 AUTHOR
120              
121             Gabriel Weinberg
122              
123             =head1 COPYRIGHT AND LICENSE
124              
125             This software is copyright (c) 2009 by Gabriel Weinberg.
126              
127             This is free software; you can redistribute it and/or modify it under
128             the same terms as the Perl 5 programming language system itself.
129              
130             =cut
131              
132              
133             __END__