File Coverage

blib/lib/Test/Shared/Fixture/Wikibase/Datatype/Statement/Wikidata/InstanceOf/CommonLivingOrganism.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 26 26 100.0


line stmt bran cond sub pod time code
1             package Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism;
2              
3 6     6   347282 use base qw(Wikibase::Datatype::Statement);
  6         40  
  6         2511  
4 6     6   39 use strict;
  6         15  
  6         130  
5 6     6   35 use warnings;
  6         16  
  6         133  
6              
7 6     6   2408 use Wikibase::Datatype::Snak;
  6         21  
  6         214  
8 6     6   2305 use Wikibase::Datatype::Value::Item;
  6         18  
  6         893  
9              
10             our $VERSION = 0.30;
11              
12             sub new {
13 2     2 1 145 my $class = shift;
14              
15 2         15 my @params = (
16             'snak' => Wikibase::Datatype::Snak->new(
17             'datatype' => 'wikibase-item',
18             'datavalue' => Wikibase::Datatype::Value::Item->new(
19             'value' => 'Q55983715',
20             ),
21             'property' => 'P31',
22             ),
23             'property_snaks' => [
24             Wikibase::Datatype::Snak->new(
25             'datatype' => 'wikibase-item',
26             'datavalue' => Wikibase::Datatype::Value::Item->new(
27             'value' => 'Q20717272',
28             ),
29             'property' => 'P642',
30             ),
31             Wikibase::Datatype::Snak->new(
32             'datatype' => 'wikibase-item',
33             'datavalue' => Wikibase::Datatype::Value::Item->new(
34             'value' => 'Q26972265',
35             ),
36             'property' => 'P642',
37             ),
38             ],
39             );
40              
41 2         39 my $self = $class->SUPER::new(@params);
42              
43 2         23 return $self;
44             }
45              
46             1;
47              
48             __END__
49              
50             =pod
51              
52             =encoding utf8
53              
54             =head1 NAME
55              
56             Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism - Test instance for Wikidata statement.
57              
58             =head1 SYNOPSIS
59              
60             use Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism;
61              
62             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism->new(%params);
63             my $id = $obj->id;
64             my $property_snaks_ar = $obj->property_snaks;
65             my $rank = $obj->rank;
66             my $referenes_ar = $obj->references;
67             my $snak = $obj->snak;
68              
69             =head1 METHODS
70              
71             =head2 C<new>
72              
73             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism->new(%params);
74              
75             Constructor.
76              
77             Returns instance of object.
78              
79             =head2 C<id>
80              
81             my $id = $obj->id;
82              
83             Get id of statement.
84              
85             Returns string.
86              
87             =head2 C<property_snaks>
88              
89             my $property_snaks_ar = $obj->property_snaks;
90              
91             Get property snaks.
92              
93             Returns reference to array with Wikibase::Datatype::Snak instances.
94              
95             =head2 C<rank>
96              
97             my $rank = $obj->rank;
98              
99             Get rank value.
100              
101             =head2 C<references>
102              
103             my $referenes_ar = $obj->references;
104              
105             Get references.
106              
107             Returns reference to array with Wikibase::Datatype::Reference instance.
108              
109             =head2 C<snak>
110              
111             my $snak = $obj->snak;
112              
113             Get main snak.
114              
115             Returns Wikibase::Datatype::Snak instance.
116              
117             =head1 EXAMPLE
118              
119             =for comment filename=fixture_create_and_print_statement_wd_instance_of_common_living_organism.pl
120              
121             use strict;
122             use warnings;
123              
124             use Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism;
125             use Wikibase::Datatype::Print::Statement;
126              
127             # Object.
128             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism->new;
129              
130             # Print out.
131             print scalar Wikibase::Datatype::Print::Statement::print($obj);
132              
133             # Output:
134             # P31: Q55983715 (normal)
135             # P642: Q20717272
136             # P642: Q26972265
137              
138             =head1 DEPENDENCIES
139              
140             L<Wikibase::Datatype::Snak>,
141             L<Wikibase::Datatype::Statement>,
142             L<Wikibase::Datatype::Value::Item>.
143              
144             =head1 SEE ALSO
145              
146             =over
147              
148             =item L<Wikibase::Datatype>
149              
150             Wikibase datatypes.
151              
152             =item L<Wikibase::Datatype::Statement>
153              
154             Wikibase statement datatype.
155              
156             =back
157              
158             =head1 REPOSITORY
159              
160             L<https://github.com/michal-josef-spacek/Wikibase-Datatype>
161              
162             =head1 AUTHOR
163              
164             Michal Josef Špaček L<mailto:skim@cpan.org>
165              
166             L<http://skim.cz>
167              
168             =head1 LICENSE AND COPYRIGHT
169              
170             © 2020-2023 Michal Josef Špaček
171              
172             BSD 2-Clause License
173              
174             =head1 VERSION
175              
176             0.30
177              
178             =cut