| 1 | package Wikibase::Datatype::Mediainfo; | ||
| 2 | |||
| 3 | 15 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 15 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 15 | ▶ | use Error::Pure qw(err); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 15 | ▶ | use Mo qw(build default is); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 15 | ▶ | use Mo::utils qw(check_number check_number_of_items); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 15 | ▶ | use Mo::utils::Array qw(check_array_object); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 15 | our $VERSION = 0.40; | |
| 12 | |||
| 13 | 15 | has descriptions => ( | |
| 14 | default => [], | ||
| 15 | is => 'ro', | ||
| 16 | ); | ||
| 17 | |||
| 18 | 15 | has id => ( | |
| 19 | is => 'ro', | ||
| 20 | ); | ||
| 21 | |||
| 22 | 15 | has labels => ( | |
| 23 | default => [], | ||
| 24 | is => 'ro', | ||
| 25 | ); | ||
| 26 | |||
| 27 | 15 | has lastrevid => ( | |
| 28 | is => 'ro', | ||
| 29 | ); | ||
| 30 | |||
| 31 | 15 | has modified => ( | |
| 32 | is => 'ro', | ||
| 33 | ); | ||
| 34 | |||
| 35 | 15 | has ns => ( | |
| 36 | default => 6, | ||
| 37 | is => 'ro', | ||
| 38 | ); | ||
| 39 | |||
| 40 | 15 | has page_id => ( | |
| 41 | is => 'ro', | ||
| 42 | ); | ||
| 43 | |||
| 44 | 15 | has statements => ( | |
| 45 | default => [], | ||
| 46 | is => 'ro', | ||
| 47 | ); | ||
| 48 | |||
| 49 | 15 | has title => ( | |
| 50 | is => 'ro', | ||
| 51 | ); | ||
| 52 | |||
| 53 | 21 | ▶ | sub BUILD { |
|
Subroutine
BUILD: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 54 | 21 | my $self = shift; | |
| 55 | |||
| 56 | # Check descriptions. | ||
| 57 | 21 | check_array_object($self, 'descriptions', 'Wikibase::Datatype::Value::Monolingual'); | |
| 58 | 20 | check_number_of_items($self, 'descriptions', 'language', 'Description', 'language'); | |
| 59 | |||
| 60 | # Check labels. | ||
| 61 | 19 | check_array_object($self, 'labels', 'Wikibase::Datatype::Value::Monolingual'); | |
| 62 | 18 | check_number_of_items($self, 'labels', 'language', 'Label', 'language'); | |
| 63 | |||
| 64 | # Check page id. | ||
| 65 | 17 | check_number($self, 'page_id'); | |
| 66 | |||
| 67 | # Check statements. | ||
| 68 | 16 | check_array_object($self, 'statements', 'Wikibase::Datatype::MediainfoStatement'); | |
| 69 | |||
| 70 | 15 | return; | |
| 71 | } | ||
| 72 | |||
| 73 | 15 | 1; | |
| 74 | |||
| 75 | __END__ | ||