File Coverage

blib/lib/WWW/WolframAlpha/Assumptions.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::Assumptions;
2              
3 1     1   16 use 5.008008;
  1         4  
  1         47  
4 1     1   5 use strict;
  1         2  
  1         54  
5 1     1   17 use warnings;
  1         2  
  1         46  
6              
7             require Exporter;
8              
9 1     1   597 use WWW::WolframAlpha::Assumption;
  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              
38 0           my ($count,$assumption);
39              
40 0 0         if ($xmlo) {
41 0   0       $count = $xmlo->{'count'} || undef;
42 0   0       $assumption = $xmlo->{'assumption'} || undef;
43              
44 0 0         $self->{'count'} = $count if defined $count;
45              
46 0 0         if (defined $assumption) {
47 0           @{$self->{'assumption'}} = ();
  0            
48 0           foreach my $value (@{$assumption}) {
  0            
49 0           push(@{$self->{'assumption'}}, WWW::WolframAlpha::Assumption->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 assumption {shift->{'assumption'};}
60              
61              
62             # Preloaded methods go here.
63              
64             1;
65              
66              
67             =pod
68              
69             =head1 NAME
70              
71             WWW::WolframAlpha::Assumptions
72              
73             =head1 VERSION
74              
75             version 1.10
76              
77             =head1 SYNOPSIS
78              
79             if ($query->assumptions->count) {
80             print "\n\nAssumptions\n";
81             foreach my $assumption (@{$query->assumptions->assumption}) {
82             ..
83             }
84             }
85              
86             =head1 DESCRIPTION
87              
88             =head2 ATTRIBUTES
89              
90             $assumptions->count
91              
92             =head2 SECTOINS
93              
94             $assumptions->assumption - array of L elements
95              
96             =head2 EXPORT
97              
98             None by default.
99              
100             =head1 NAME
101              
102             WWW::WolframAlpha::Assumptions - Perl object returned via $wa->(?:validate|)query->assumptions
103              
104             =head1 SEE ALSO
105              
106             L
107              
108             =head1 AUTHOR
109              
110             Gabriel Weinberg, Eyegg@alum.mit.eduE
111              
112             =head1 COPYRIGHT AND LICENSE
113              
114             Copyright (C) 2009 by Gabriel Weinberg
115              
116             This library is free software; you can redistribute it and/or modify
117             it under the same terms as Perl itself, either Perl version 5.8.8 or,
118             at your option, any later version of Perl 5 you may have available.
119              
120             =head1 AUTHOR
121              
122             Gabriel Weinberg
123              
124             =head1 COPYRIGHT AND LICENSE
125              
126             This software is copyright (c) 2009 by Gabriel Weinberg.
127              
128             This is free software; you can redistribute it and/or modify it under
129             the same terms as the Perl 5 programming language system itself.
130              
131             =cut
132              
133              
134             __END__