| 1 | package Data::Image; | ||
| 2 | |||
| 3 | 13 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 13 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 13 | ▶ | use Mo qw(build is); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 13 | ▶ | use Mo::utils 0.28 qw(check_code check_isa check_length check_number check_number_id check_required); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 13 | ▶ | use Mo::utils::Number qw(check_positive_natural); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 13 | ▶ | use Mo::utils::URI qw(check_location); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 13 | our $VERSION = 0.06; | |
| 12 | |||
| 13 | 13 | has author => ( | |
| 14 | is => 'ro', | ||
| 15 | ); | ||
| 16 | |||
| 17 | 13 | has comment => ( | |
| 18 | is => 'ro', | ||
| 19 | ); | ||
| 20 | |||
| 21 | 13 | has dt_created => ( | |
| 22 | is => 'ro', | ||
| 23 | ); | ||
| 24 | |||
| 25 | 13 | has height => ( | |
| 26 | is => 'ro', | ||
| 27 | ); | ||
| 28 | |||
| 29 | 13 | has id => ( | |
| 30 | is => 'ro', | ||
| 31 | ); | ||
| 32 | |||
| 33 | 13 | has metadata => ( | |
| 34 | is => 'ro', | ||
| 35 | ); | ||
| 36 | |||
| 37 | 13 | has size => ( | |
| 38 | is => 'ro', | ||
| 39 | ); | ||
| 40 | |||
| 41 | 13 | has url => ( | |
| 42 | is => 'ro', | ||
| 43 | ); | ||
| 44 | |||
| 45 | 13 | has url_cb => ( | |
| 46 | is => 'ro', | ||
| 47 | ); | ||
| 48 | |||
| 49 | 13 | has width => ( | |
| 50 | is => 'ro', | ||
| 51 | ); | ||
| 52 | |||
| 53 | 28 | ▶ | sub BUILD { |
|
Subroutine
BUILD: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 54 | 28 | my $self = shift; | |
| 55 | |||
| 56 | # Check author. | ||
| 57 | 28 | check_length($self, 'author', 255); | |
| 58 | |||
| 59 | # Check comment. | ||
| 60 | 27 | check_length($self, 'comment', 1000); | |
| 61 | |||
| 62 | # Check date created. | ||
| 63 | 26 | check_isa($self, 'dt_created', 'DateTime'); | |
| 64 | |||
| 65 | # Check height. | ||
| 66 | 26 | check_number($self, 'height'); | |
| 67 | |||
| 68 | # Check id. | ||
| 69 | 26 | check_positive_natural($self, 'id'); | |
| 70 | |||
| 71 | # Check metadata. | ||
| 72 | 25 | check_isa($self, 'metadata', 'Data::Metadata'); | |
| 73 | |||
| 74 | # Check size. | ||
| 75 | 24 | check_number($self, 'size'); | |
| 76 | |||
| 77 | # Check URL. | ||
| 78 | 24 | check_length($self, 'url', 255); | |
| 79 | 23 | check_location($self, 'url'); | |
| 80 | |||
| 81 | # Check URL callback. | ||
| 82 | 22 | check_code($self, 'url_cb'); | |
| 83 | |||
| 84 | # Check width. | ||
| 85 | 22 | check_number($self, 'width'); | |
| 86 | |||
| 87 | 22 | return; | |
| 88 | } | ||
| 89 | |||
| 90 | 13 | 1; | |
| 91 | |||
| 92 | __END__ | ||